locked
How do I find out if a document is in the "no edit, downloaded" mode? RRS feed

  • Question

  • I'm finding Range.Find() consistently does not return for documents in that mode. So I want to avoid calling it in that case.

    thanks - dave


    Very funny video - Reporting as a Metaphor
    Monday, September 13, 2010 8:11 PM

Answers

  • Hi Dave

    Try the ProtectedViewWindows collection and ProtectedViewWindow object. Something along the lines of:

    For each pvw in ProtectedViewWindows
      If pvw.Document.Name = sNameOfDocOpened Then
        pvw.Edit()
      End If
    Next


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by DavidThi808 Tuesday, September 14, 2010 4:56 PM
    Tuesday, September 14, 2010 3:25 PM

All replies

  • Hello Dave,

    Thanks for posting. I read your post carefully, but I think your question is unclear for me so that currently I cannot give much helpful information on this. To provide further assistance, would you mind clarifying some points?

    • What do you mean the "no edit, download" mode?
    • What the Range.Find() method is for? Is this method related to be that mode?

    To get a better understand on this topic, posting your codes or sharing your project would be welcome.

    I am looking forward to your reply. Have a nice day.

    Best regards,
    Bessie Zhao - MSFT
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Tuesday, September 14, 2010 3:22 AM
  • Hi Bessie;

    By the no edit mode I mean that when you download a DOCX file from the internet, when Word 2010 first opens it it says that it could be dangerous because it was downloaded in a bar across the top and there is a button that says "enable editing." Until you click that button the document is in a restricted read/only mode.

    The method that does not return is the Word API Range.Find() method. It pretty consistently will not return on a call - only if Word is in this safe mode. The error is documented in more detail at http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/4ff3414b-ca6e-4347-a2b1-a5cdcc895b62 - but we just figured out that it only occurs when Word has a document in safe mode.

    thanks - dave


    Very funny video - Reporting as a Metaphor
    Tuesday, September 14, 2010 1:16 PM
  • Hi Dave

    Try the ProtectedViewWindows collection and ProtectedViewWindow object. Something along the lines of:

    For each pvw in ProtectedViewWindows
      If pvw.Document.Name = sNameOfDocOpened Then
        pvw.Edit()
      End If
    Next


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by DavidThi808 Tuesday, September 14, 2010 4:56 PM
    Tuesday, September 14, 2010 3:25 PM
  • perfect - thanks
    Very funny video - Reporting as a Metaphor
    Tuesday, September 14, 2010 4:57 PM