共用方式為


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

Concepts

Actions Object

Actions Object Members