Forward Method

Microsoft Outlook Visual Basic

Show All

Forward Method

       

Executes the Forward action for an item. Returns the resulting copy as a new object (as a MeetingItem object for the MeetingItem object, or a MailItem object for all other objects in the Applies To list).

expression.Forward

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This Visual Basic for Applications example uses the GetDefaultFolder method to return the MAPIFolder object that represents the default Inbox folder for the current user. It then uses the Forward method to retrieve the first message in the default Inbox folder and forward it to Laura Jennings. The Add method is used to add Laura Jennings to the Recipients collection and the Send method sends the item to all recipients. It is assumed that the name will resolve unambiguously in the Address Book.

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myForward = myFolder.Items(1).Forward
myForward.Recipients.Add "Laura Jennings"
myForward.Send

If you use VBScript, you do not create the Application object, and you cannot use named constants. This example shows how to perform the same task using VBScript.

Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(6)
Set myForward = myFolder.Items(1).Forward
myForward.Recipients.Add "Laura Jennings"
myForward.Send