Редагувати

Поділитися через


Attachments object (Outlook)

Contains a set of Attachment objects that represent the attachments in an Outlook item.

Remarks

Use the Attachments property to return the Attachments collection for any Outlook item (except notes).

Use the Add method to add an attachment to an item.

To ensure consistent results, always save an item before adding or removing objects in the Attachments collection of the item.

Example

The following Visual Basic for Applications (VBA) example creates a new mail message, attaches a Q496.xls as an attachment (not a link), and gives the attachment a descriptive caption.

Set myItem = Application.CreateItem(olMailItem) 
 
myItem.Save 
 
Set myAttachments = myItem.Attachments 
 
myAttachments.Add "C:\My Documents\Q496.xls", _ 
 
 olByValue, 1, "4th Quarter 1996 Results Chart"

Methods

Name
Add
Item
Remove

Properties

Name
Application
Class
Count
Parent
Session

See also

Attach a File to a Mail Item Attach an Outlook Contact Item to an Email Message Limit the Size of an Attachment to an Outlook Email Message Modify an Attachment of an Outlook Email Message Attachments Object Members Outlook Object Model Reference

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.