Microsoft KB Archive/924610
Article ID: 924610
Article Last Modified on 1/17/2007
- Microsoft Outlook 2000 Standard Edition
Consider the following scenario:
- In Microsoft Outlook 2000, you click an e-mail message in the Inbox, and then you click Reply.
- You add an attachment to the e-mail message by using the Attachments.Add method in the Microsoft Outlook object model.
In this scenario, the body text of the e-mail message disappears.
To work around this problem, call the Save method before and after you add an attachment to the e-mail message by using the Attachments.Add method. The following Microsoft Visual Basic script code sample demonstrates how to do this.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Sub AttachFile() Dim mi As MailItem Set mi = Application.ActiveInspector.CurrentItem mi.Save mi.Attachments.Add "C:\test.txt" mi.Save End Sub
Note If you use this workaround, a draft of the e-mail message is automatically saved in the Drafts folder. This behavior occurs because the Save method explicitly saves the e-mail message in the Drafts folder.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
This problem only occurs in Outlook 2000. This problem was corrected in Outlook 2002 and Outlook 2003.
For more information about the Attachments.Add method in Outlook 2000, visit the following Microsoft Developer Network (MSDN) Web site:
For more information about the Save method in Outlook 2000, visit the following MSDN Web site:
Keywords: kbcode kbemail kbtshoot kbprb KB924610