Share via


MailItem.Actions Property

Outlook Developer Reference

Returns an Actions collection that represents all the available actions for the item. Read-only.

Syntax

expression.Actions

expression   A variable that represents a MailItem object.

Example

This Visual Basic for Applications (VBA) example creates a new mail item and uses the Actions.Add method to add an Action to it. Then it sends the mail item to the current user. The mail item received will have the Agree action in addition to the standard actions such as Reply and Reply All.

Visual Basic for Applications
  Sub AddAction()
    Dim myItem As Outlook.MailItem
    Dim myAction As Outlook.Action
Set myItem = Application.CreateItem(olMailItem)
Set myAction = myItem.<strong class="bterm">Actions</strong>.Add
myAction.Name = "Agree"
myItem.To = Application.GetNamespace("MAPI").CurrentUser
myItem.Send

End Sub

The following Visual Basic for Applications example creates a new mail item and uses the Actions.Add method to add an Action called Link Original to it. Executing this action will insert a link to the original mail item.

Visual Basic for Applications
  Sub AddAction2()
   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

See Also