SYMPTOMS
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.
WORKAROUND
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. If you close the e-mail message
without sending it, Outlook asks if you want to save the changes. If you click
No, the draft remains in the Drafts folder anyway. This
behavior occurs because the
Save method explicitly saves the e-mail message in the Drafts
folder.