ContactItem 属性 (Outlook)ContactItem.DownloadState property (Outlook)

返回一个属于**OlDownloadState** 枚举的常量, 该常量指示项目的下载状态。Returns a constant that belongs to the OlDownloadState enumeration indicating the download state of the item. 此为只读属性。Read-only.

语法Syntax

expressionexpression. DownloadState

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

示例Example

下面的 Microsoft Visual Basic for Applications (VBA) 示例在用户的 "收件箱" 中搜索尚未完全下载的项目。The following Microsoft Visual Basic for Applications (VBA) example searches through the user's Inbox for items that have not yet been fully downloaded. 如果找到此类项目,则会向用户显示一条消息,并将该项目标记为下载。If any not yet fully downloaded items are found, a message is displayed to the user, and the item is marked for download.

Sub DownloadItems() 
 
 Dim mpfInbox As Outlook.Folder 
 
 Dim objItems As Outlook.Items 
 
 Dim obj As Object 
 
 Dim i As Integer 
 
 Dim iCount As Integer 
 
 
 
 Set mpfInbox = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox) 
 
 Set objItems = mpfInbox.Items 
 
 iCount = objItems.Count 
 
 'Loop all items in the Inbox folder 
 
 For i = 1 To iCount 
 
 Set obj = objItems.Item(i) 
 
 'Verify if the state of the item is olHeaderOnly 
 
 If obj.DownloadState = olHeaderOnly Then 
 
 MsgBox "This item has not been fully downloaded." 
 
 'Mark the item to be downloaded 
 
 obj.MarkForDownload = olMarkedForDownload 
 
 obj.Save 
 
 End If 
 
 Next 
 
End Sub

另请参阅See also

创建 ContactItem 对象ContactItem 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.