Search code examples
outlookvstooutlook-addinoffice-interopoffice-addins

Outlook.MailItem.DownloadState What it is and what it is used for?


I have seen the property Outlook.MailItem.DownloadState which is explained here. Anyway I am not able to understand what is it and what is it used for. Some can explain me that?


Solution

  • To decrease the capacity of the local storage and save the bandwidth users may not download large emails getting only a small subset of data (metadata) which contains the headers describing the email.

    There are possible states for the MailItem.DownloadState property:

    • The olHeaderOnly means only the header has been downloaded.
    • The olFullItem value means the full item has been downloaded.

    If the message was not fully downloaded in Outlook you can set the MailItem.MarkForDownload property. It returns or sets an OlRemoteStatus constant that determines the status of an item once it is received by a remote user.

    if(obj.DownloadState == olHeaderOnly)
    { 
       'Mark the item to be downloaded
        obj.MarkForDownload = olMarkedForDownload;
    }