Class Actions (Outlook VBA)

Contains a collection of Action objects that represent all the specialized actions that can be executed on an Outlook item. To use a Actions class variable it first needs to be instantiated, for example


Dim acts as Actions
Set acts = Session.CreateSharingItem.Reply.Actions

For Each

Here is an example of processing the Actions items in a collection.


Dim act As Action
For Each act In Session.CreateSharingItem.Reply.Actions
	
Next act

Add

Creates a new action in the Actions collection.


Sub AddAction() 
 
 Dim myItem As Outlook.MailItem 
 
 Dim myAction As Outlook.Action 
 
 
 
 Set myItem = Application.CreateItem(olMailItem) 
 
 Set myAction = myItem.Actions.Add 
 
 myAction.Name = "Link Original" 
 
 myAction.ShowOn = olMenuAndToolbar 
 
 myAction.ReplyStyle = olLinkOriginalItem 
 
 myItem.To = "Dan Wilson" 
 
 myItem.Send 
 
End Sub

Class

Returns an OlObjectClass constant indicating the object's class. Here you can find possible values for OlObjectClass.


Dim oocsClass As OlObjectClass
oocsClass = Session.CreateSharingItem.Reply.Actions.Class

Count

Returns a Long indicating the count of objects in the specified collection.


Dim lngCount As Long
lngCount = Session.CreateSharingItem.Reply.Actions.Count

Item

Returns an Action object from the collection.

Item (Index)

Index: Either the index number of the object, or a value used to match the default property of an object in the collection.


Dim act As Action
Set act = Session.CreateSharingItem.Reply.Actions(Index:=1)

Remove

Removes an object from the collection.

Remove (Index)

Index: The 1-based index value of the object within the collection.


Dim lngIndex As Long: lngIndex = 
Session.CreateSharingItem.Reply.Actions.Remove Index:=lngIndex

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 do the same function: