G
Gary Petersen
I'd like to create a macro in Outlook 2007 to attach a specific file to an
open message. I've been searching and have the following bit of code, but it
creates a new blank message with the file attached. I'm close, but am not
sure how to get this to work in the existing open message.
Here's the code I've got so far.
Sub Attach_MyFile()
Set NewItem = Application.CreateItem(0)
NewItem.Attachments.Add "\\path\filename"
NewItem.Display
End Sub
\\path\filename would be changed to the specific file I want to attach.
It works just fine, but creates a new message. What would I change to add
this file attachment to the existing open message? In other words, what is
the command that would be like Application.EditItem(0)?
Thanks for any help. I do appreciate it.
open message. I've been searching and have the following bit of code, but it
creates a new blank message with the file attached. I'm close, but am not
sure how to get this to work in the existing open message.
Here's the code I've got so far.
Sub Attach_MyFile()
Set NewItem = Application.CreateItem(0)
NewItem.Attachments.Add "\\path\filename"
NewItem.Display
End Sub
\\path\filename would be changed to the specific file I want to attach.
It works just fine, but creates a new message. What would I change to add
this file attachment to the existing open message? In other words, what is
the command that would be like Application.EditItem(0)?
Thanks for any help. I do appreciate it.