CreateItemFromTemplate Method Example

This Visual Basic for Applications example uses CreateItemFromTemplate to create a new item from an Outlook template and then displays it.

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItemFromTemplate _
    ("C:\Program Files\Microsoft Office\Templates\Outlook\While You Were Out.oft")
myItem.Display

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

Set myItem = Application.CreateItemFromTemplate _
    ("C:\Program Files\Microsoft Office\Templates\Outlook\While You Were Out.oft")
myItem.Display