The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MailItem Object

Office 2007
Represents a mail message in an Inbox folder.


Use the CreateItem method to create a MailItem object that represents a new mail message.

Use Items (

index), where index is the index number of a mail message or a value used to match the default property of a message, to return a single MailItem object from an Inbox folder.


The following example creates and displays a new mail message.

Visual Basic for Applications
Set myItem = Application.CreateItem(olMailItem)

The following example sets the current folder as the Inbox and displays the second mail message in the folder.

Visual Basic for Applications
Set myNamespace = Application.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items(2)

Community Additions