OL2002: Attachment Not Visible When Added to Item in the Open Event (294361)



The information in this article applies to:

  • Microsoft Outlook 2002

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

  1. Create a custom mail message form with the following VBScript code:
    Function Item_Open()
       If Not Item.Sent then
          Item.Attachments.Add "C:\Test.txt", 1
       End If
    End Function
    					
  2. 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.
  3. Run the form.
The result is that the mail message is displayed, but the attachment is not visible.

REFERENCES

For additional information about available resources and answersto commonly asked questions about Microsoft Outlook solutions, click the article number below to view the article in the Microsoft Knowledge Base:

287530 OL2002: Questions About Custom Forms and Outlook Solutions


Modification Type:MinorLast Reviewed:3/1/2004
Keywords:kbbug kbnofix KB294361