Application.CreateItemFromTemplate method (Outlook)

Creates a new Microsoft Outlook item from an Outlook template (.oft) and returns the new item.


expression. CreateItemFromTemplate( _TemplatePath_ , _InFolder_ )

expression A variable that represents an Application object.


Name Required/Optional Data type Description
TemplatePath Required String The path and file name of the Outlook template for the new item.
InFolder Optional Variant The folder in which the item is to be created. If this argument is omitted, the default folder for the item type will be used.

Return value

An Object value that represents the new Outlook item.


New items will always open in compose mode, as opposed to read mode, regardless of the mode in which the items were saved to disk.


This Visual Basic for Applications (VBA) example uses CreateItemFromTemplate to create a new item from an Outlook template and then displays it. The CreateTemplate macro shows you how to create the template that is used in the first example. To avoid errors, replace 'Dan Wilson' with a valid name in your address book.

Sub CreateFromTemplate() 
 Dim MyItem As Outlook.MailItem 
 Set MyItem = Application.CreateItemFromTemplate("C:\statusrep.oft") 
End Sub 
Sub CreateTemplate() 
 Dim MyItem As Outlook.MailItem 
 Set MyItem = Application.CreateItem(olMailItem) 
 MyItem.Subject = "Status Report" 
 MyItem.To = "Dan Wilson" 
 MyItem.SaveAs "C:\statusrep.oft", OlSaveAsType.olTemplate 
End Sub

The following Visual Basic for Applications (VBA) example shows how to use the optional InFolder parameter when calling the CreateItemFromTemplate method.

Sub CreateFromTemplate2() 
 Dim MyItem As Outlook.MailItem 
 Set MyItem = Application.CreateItemFromTemplate("C:\statusrep.oft", _ 
End Sub

See also

Application 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.