Class AttachmentSelection (Outlook VBA)
Contains a set of Attachment objects that represent the selected attachments in an Outlook item. To use a AttachmentSelection class variable it first needs to be instantiated, for example
Dim asn as AttachmentSelection
Set asn = ActiveInspector.AttachmentSelection
Class
Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for
Dim oocsClass As OlObjectClass
oocsClass = ActiveInspector.AttachmentSelection.Class
Count
Returns a Long indicating the count of objects in the specified collection.
Dim lngCount As Long
lngCount = ActiveInspector.AttachmentSelection.Count
GetSelection
Returns a Selection object that contains the kind of objects specified by the SelectionContents parameter, and that are currently selected in the active explorer where the parent item of the AttachmentSelection object is.
The only reason that this method is exposed on the AttachmentSelection object is because the AttachmentSelection inherits from the Selection object. This method is not intended to be called on the AttachmentSelection object.
GetSelection (SelectionContents)
SelectionContents: Specifies the kind of objects in the selection to return.
Dim slcGetSelection As Selection
Set slcGetSelection = ActiveInspector.AttachmentSelection.GetSelection(SelectionContents:=olConversationHeaders)
Item
Returns an Attachment object from the collection.
Item (Index)
Index: Either the index number of the object, or the value used to match the default property of an object in the collection.
Dim attAttachmentSelection As Attachment
Set attAttachmentSelection = ActiveInspector.AttachmentSelection(Index:=1)
Location
Returns a OlSelectionLocation constant that specifies where the attachment selection is in the Microsoft Outlook user interface. Read-only Possible return values are olAttachmentWell - The selection is an attachment of an item in the Reading Pane or inspector, olDailyTaskList - The selection is in the daily Tasks list in the calendar view, olToDoBarAppointmentList - The selection is in the list of appointments in the To-Do Bar, olToDoBarTaskList - The selection is in the list of tasks in the To-Do Bar, olViewList - The selection is in a list of items in an explorer.
This property always returns the constant olAttachmentWell.
Dim oslLocation As OlSelectionLocation
oslLocation = ActiveInspector.AttachmentSelection.Location
Session
Returns the NameSpace object for the current session.
The Session property and the GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements perform the same function: