This documentation is archived and is not being maintained.

ContactItem.DownloadState Property

Office 2007
Returns a constant that belongs to the OlDownloadState enumeration indicating the download state of the item. Read-only.



expression   A variable that represents a ContactItem object.


The following Microsoft Visual Basic/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.

Visual Basic for Applications
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
        End If
End Sub