Items Collection Object

Items Collection Object

See Also         Properties         Methods         Events

Folders collection (MAPIFolder object)
Items collection (Item object)
Multiple objects

A collection of Outlook item objects in a folder.

Using the Items Collection

Use the Items property to return the Items collection of a MAPIFolder object.

Use Items(index), where index is the name or index number, to return a single Outlook item.

The following Visual Basic for Applications example returns the first item with the subject "Need your advice" in myFolder.

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = _
    myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items("Need your advice")

The following Visual Basic for Applications example returns the first item in myFolder.

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
Set myFolder = _
    myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItem = myFolder.Items(1)

The following VBScript example returns the first item in myFolder.

Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(6)
Set myItem = myFolder.Items(1)