Skip to content

Latest commit

 

History

History
144 lines (80 loc) · 2.91 KB

Outlook.Items.md

File metadata and controls

144 lines (80 loc) · 2.91 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Items object (Outlook)
vbaol11.chm2998
vbaol11.chm2998
Outlook.Items
3a99730b-e62a-5ca6-f6ec-911c95173242
06/08/2017
medium

Items object (Outlook)

Contains a collection of Outlook item objects in a folder.

Remarks

Use the Items property to return the Items object of a Folder object.

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

Note

The index for the Items collection starts at 1, and the items in the Items collection object are not guaranteed to be in any particular order.

Example

The following Microsoft Visual Basic for Applications (VBA) example returns the first item in the Inbox with the Subject "Need your advice."

Sub GetItem() 
 
 Dim myNameSpace As Outlook.NameSpace 
 
 Dim myFolder As Outlook.Folder 
 
 Dim myItem As Object 
 
 
 
 Set myNameSpace = Application.GetNameSpace("MAPI") 
 
 Set myFolder = _ 
 
 myNameSpace.GetDefaultFolder(olFolderInbox) 
 
 Set myItem = myFolder.Items("Need your advice") 
 
 myItem.Display 
 
End sub

The following VBA example returns the first item in the Inbox. In Microsoft Office Outlook 2003 or later, the Items object returns the items in an Offline Folders file (.ost) in the reverse order.

Sub GetItem() 
 
 Dim myNameSpace As Outlook.NameSpace 
 
 Dim myFolder As Outlook.Folder 
 
 Dim myItem As Object 
 
 
 
 Set myNameSpace = Application.GetNameSpace("MAPI") 
 
 Set myFolder = _ 
 
 myNameSpace.GetDefaultFolder(olFolderInbox) 
 
 Set myItem = myFolder.Items(1) 
 
 myItem.Display 
 
End sub

Events

Name
ItemAdd
ItemChange
ItemRemove

Methods

Name
Add
Find
FindNext
GetFirst
GetLast
GetNext
GetPrevious
Item
Remove
ResetColumns
Restrict
SetColumns
Sort

Properties

Name
Application
Class
Count
IncludeRecurrences
Parent
Session

See also

Items Object Members Outlook Object Model Reference

[!includeSupport and feedback]