Rediger

Del via


Actions.Add method (Outlook)

Creates a new action in the Actions collection.

Syntax

expression.Add

expression A variable that represents an Actions object.

Return value

An Action object that represents the new action.

Example

This VBA example creates a new mail message and uses the Add method to add an Action to it. To run this example without any errors, replace 'Dan Wilson' with a valid recipient name.

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

See also

Actions Object

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.