Microsoft KB Archive/294361

= OL2002: Attachment Not Visible When Added to Item in the Open Event =

Article ID: 294361

Article Last Modified on 3/1/2004

-

APPLIES TO


 * Microsoft Outlook 2002 Standard Edition

-



This article was previously published under Q294361





SYMPTOMS
If you programmatically add an attachment to an item using Microsoft Visual Basic Scripting Edition (VBScript) in a custom form's Open event, you cannot see the attachment.



WORKAROUND
In addition to attaching a file in the Open event, set the Body property. However, this typically has the undesirable side effect of replacing the body with unformatted text.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
Although the attachment is not displayed, if you send the mail message, the attachment is properly sent. This problem happens regardless of which mail format you use.

Steps to Reproduce the Problem
  Create a custom mail message form with the following VBScript code: Function Item_Open If Not Item.Sent then Item.Attachments.Add &quot;C:\Test.txt&quot;, 1 End If End Function  Either create a sample file called C:\Text.txt, or modify the preceding code to point to a valid file to attach to the mail message. Run the form.

The result is that the mail message is displayed, but the attachment is not visible.

