Items 对象 (Outlook)Items object (Outlook)

在文件夹中包含 Outlook 项对象集合。Contains a collection of Outlook item objects in a folder.

注释Remarks

使用**items** 属性返回**Folder** 对象的items对象。Use the Items property to return the Items object of a Folder object.

使用项目(索引), 其中_索引_是名称或索引号, 返回单个 Outlook 项目。Use Items (index), where index is the name or index number, to return a single Outlook item.

备注

Items集合的索引从 1 开始, Items集合对象中的项目不能保证在任何特定的顺序。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

以下 Microsoft Visual Basic for Applications (VBA) 示例返回 “收件箱” 中主题为“Need your advice”的第一个项目。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

以下 VBA 示例返回“收件箱”中的第一个项目。The following VBA example returns the first item in the Inbox. 在 Microsoft Office Outlook 2003 或更高版本中,此 Items 对象以逆序返回脱机文件夹文件 (.ost) 中的项目。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
ItemAddItemAdd
ItemChangeItemChange
ItemRemoveItemRemove

方法Methods

名称Name
AddAdd
查找Find
FindNextFindNext
GetFirstGetFirst
GetLastGetLast
GetNextGetNext
GetPreviousGetPrevious
Item
RemoveRemove
ResetColumnsResetColumns
RestrictRestrict
SetColumnsSetColumns
SortSort

属性Properties

名称Name
ApplicationApplication
ClassClass
CountCount
IncludeRecurrencesIncludeRecurrences
ParentParent
SessionSession

另请参阅See also

Items 对象成员 Outlook 对象模型引用Items Object Members Outlook Object Model Reference

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.