다음을 통해 공유


DownloadState Property

OlDownloadState

OlDownloadState can be one of these OlDownloadState constants.
olFullItem The entire item has been downloaded.
olHeaderOnly Only the header has been downloaded.

expression.DownloadState

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Example

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.

Sub DownloadItems()
    Dim outApp As Outlook.Application
    Dim mpfInbox As Outlook.MAPIFolder
    Dim objItems As Outlook.Items
    Dim obj As Object
    Dim i As Integer
    Dim iCount As Integer

    Set outApp = CreateObject("Outlook.Application")
    Set mpfInbox = outApp.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

Applies to | AppointmentItem Object | ContactItem Object | DistListItem Object | DocumentItem Object | JournalItem Object | MailItem Object | MeetingItem Object | NoteItem Object | PostItem Object | RemoteItem Object | ReportItem Object | TaskItem Object | TaskRequestAcceptItem Object | TaskRequestDeclineItem Object | TaskRequestItem Object | TaskRequestUpdateItem Object