Microsoft KB Archive/260294

= PRB: Attachment Long File Name Truncates to 8.3 Format =

Article ID: 260294

Article Last Modified on 3/4/2004

-

APPLIES TO


 * Microsoft Collaboration Data Objects 1.2
 * Microsoft Collaboration Data Objects 1.21

-



This article was previously published under Q260294



SYMPTOMS
The Name property of a message attachment can truncate to an 8.3 format, or an eight-character file name plus a three-character extension.

For example, a file attachment originally named &quot;Longfilename.txt&quot; may have its name truncated to &quot;LONGFI~1.txt&quot;.



CAUSE
This truncation occurs when you programmatically retrieve message attachment properties with the Collaboration Data Objects (CDO) 1.2x library. Backward compatibility with platforms does not recognize long file names, and as a result truncates the Name property of the attachment to the 8.3 format.

This behavior is by design.



RESOLUTION
To resolve this behavior, obtain the original file name of the attachment (long or otherwise) using the PR_ATTACH_LONG_FILENAME MAPI property as follows.

objAttachment.Fields(cdoPR_ATTACH_LONG_FILENAME)

where objAttachment is a valid attachment object that instantiates with the CDO 1.2x library.



MORE INFORMATION
Message attachements created by one of the following methods have long file names that can be truncated to the 8.3 format:


 * Simple MAPI (SMAPI)
 * Microsoft Office applications
 * Older versions of Microsoft Outlook

When you view the message and the attachment in a regular e-mail client, the original file name (long or otherwise) displays without any change. If you programmatically retrieve message attachments with CDO 1.2x, then the property of the attachment is a truncated form of the original name.

This is an intentional behavior in accordance with the MAPI 1.0 specification, and is intended to make the attachment name compatible with operating systems that do not recognize long file names.

The original form of the attachment name is retained in the PR_ATTACH_LONG_FILENAME MAPI property.

Note that if the PR_ATTACH_LONG_FILENAME MAPI property does not exist on the attachment object, then the MAPI_E_Not_Found error (&H8004010F) occurs.

The truncated version of the attachment name is stored in the PR_ATTACH_FILENAME MAPI property.

Additional query words: longfilename filename

Keywords: kbmsg kbprb KB260294

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.