DistListItem.DownloadState 属性 (Outlook)

返回一个指示项目下载状态的常量,该常量属于 OlDownloadState 枚举。 只读。

语法

expressionDownloadState

表达 一个代表 DistListItem 对象的变量。

示例

以下 Microsoft Visual Basic for Applications (VBA) 示例在用户的 "收件箱" 中搜索尚未完全下载的项目。 如果找到此类项目,则会向用户显示一条消息,并将该项目标记为下载。

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

另请参阅

DistListItem 对象

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。