Microsoft Office Tutorials and References
In Depth Information
attachment filename when saving, as shown in this example, which saves all attachments to disk
under their original name and using the specified path:
Dim at As Outlook.Attachment
For Each at in MyMailItem.Attachments
If at.Type = olByValue Then
at.SaveAsFile(“c:\data\” & at.FileName)
Creating and Sending Messages
In addition to processing received messages, you can write macros that create and send email
messages. Outlook’s Object Model makes the task relatively simple. The MailItem object has some
properties mostly relevant when you are creating a new message to send. These properties are
described in Table 24.4.
Properties of the MailItem Object for Creating and Sending Messages
A collection that contains one Attachment object for each file
attached to the message.
A semicolon-delimited list of display names for the blind carbon copy
The text of the message for plain text messages.
A semicolon-delimited list of display names for the carbon copy (CC)
The text of the message for HTML format messages.
Set to True in order to request a read receipt for the message, False by
A collection that contains one Recipient object for each message
The Outlook folder where a copy of the message will be saved when it
is sent. The default is the Sent Items folder.
True if the message has been sent, otherwise False.
A semicolon-delimited list of display names for the message recipients.