Skip to content

CreateItem


Overview

The CreateItem method creates and returns an object specified by its ItemType parameter

Syntax

vba
Application.CreateItem(ItemType)
Parameter Name Required/Optional Type Description
ItemType Required olItemType The constant value specifying the type of object to create

Return Value

Returns an object with the specified olItemType.

Example

Example code snippet demonstrating how to create a new item:

vba
Dim MailerApp As New nlsMailer.Application
Dim newMailItem As nlsMailer.MailItem

Set newMailItem = MailerApp.CreateItem(olMailItem)