文件夹. Items 属性 (Outlook)Folder.Items property (Outlook)

以 Outlook 项目集合的形式返回指定文件夹中的**项目** 集合对象。Returns an Items collection object as a collection of Outlook items in the specified folder. 此为只读属性。Read-only.

语法Syntax

expressionexpression. Items

_表达式_一个代表Folder对象的变量。expression A variable that represents a Folder object.

说明Remarks

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

本 Visual Basic for Applications (VBA) 示例使用Items属性从默认的 "联系人" 文件夹中获取**ContactItem** 对象的集合。This Visual Basic for Applications (VBA) example uses the Items property to obtain the collection of ContactItem objects from the default Contacts folder.

Sub ContactDateCheck() 
 
 Dim myNamespace As Outlook.NameSpace 
 
 Dim myContacts As Outlook.Items 
 
 Dim myItems As Outlook.Items 
 
 Dim myItem As Object 
 
 
 
 Set myNamespace = Application.GetNamespace("MAPI") 
 
 Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts).Items 
 
 Set myItems = myContacts.Restrict("[LastModificationTime] > '01/1/2003'") 
 
 For Each myItem In myItems 
 
 If (myItem.Class = olContact) Then 
 
 MsgBox myItem.FullName & ": " & myItem.LastModificationTime 
 
 End If 
 
 Next 
 
End Sub

另请参阅See also

文件夹对象Folder Object

支持和反馈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.