How to check Outlook Mail Item in read-only mode programmatically? RRS feed

  • Question

  • Hi There,

    I have an Outlook Email contains an email attachment.

    When I open the email attachment, the email can be opened but it is in read-only mode.

    Is there any way I can check is the email in read-only mode programmatically ?

    Outlook is unlike Word, in word object, we can still use the following code to check whether the document is in read-only mode or not:

    Dim activeDoc As Word.Document = appWord.ActiveDocument
    If activeDoc.ReadOnly = True Then
    // continue the process
    End If

    Friday, October 16, 2020 9:40 AM

All replies

  • Hello,

    You can read the PR_MESSAGE_FLAGS property value and check out the MSGFLAG_UNSENT flag set. Here is what MSDN states for the flag mentioned:

    The message is still being composed. It is saved, but has not been sent. The client or provider has read/write access to this flag until the first IMAPIProp::SaveChanges call and read-only thereafter. If a client doesn't set this flag by the time the message is sent, the message store provider sets it when IMessage::SubmitMessage is called. Typically, this flag is cleared after the message is sent.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Saturday, October 17, 2020 7:53 PM