|Publisher Developer Reference|
Version Added: Publisher 2007
An Attachment object corresponds to one of the attachments in the list of attachments in the Attachments box in the Merge to E-mail dialog box in the Microsoft Office Publisher user interface. (On the File menu, point to Send E-mail, click Send E-mail Merge, and then click Options.)
To remove the attachment from the merged e-mail, use the Delete method of the Attachment object.
The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the Add method to add an attachment to an e-mail merge message. It adds an Attachment object that represents a bitmap image to the Attachments collection of the active document.
Before running this macro, place a file named image.bmp in the root of the C drive on your computer, or change the name and file path of the file in the macro to specify the one you want to attach.
Note that to send an e-mail merge message, you must connect to a data source, create the e-mail merge, and then send the message. For more information, see the EmailMergeEnvelope object topic.
|Visual Basic for Applications|