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)
End If
Next
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.
TABLE 24.4
Properties of the MailItem Object for Creating and Sending Messages
Property
Description
Attachments
A collection that contains one Attachment object for each file
attached to the message.
BCC
A semicolon-delimited list of display names for the blind carbon copy
(BCC) recipients.
Body
The text of the message for plain text messages.
CC
A semicolon-delimited list of display names for the carbon copy (CC)
recipients.
HTMLBody
The text of the message for HTML format messages.
ReadReceiptRequested
Set to True in order to request a read receipt for the message, False by
default.
Recipients
A collection that contains one Recipient object for each message
recipient.
SaveSentMessageFolder
The Outlook folder where a copy of the message will be saved when it
is sent. The default is the Sent Items folder.
Sent
True if the message has been sent, otherwise False.
To
A semicolon-delimited list of display names for the message recipients.
Search JabSto ::




Custom Search