Word: Check if password applied to Restrict formatting and editing RRS feed

  • Question

  • Hi,

    I have got a question re. the password protection for formatting restrictions.

    In VBA, for the ActiveDocument, I need to check whether formatting restrictions are applied (visible under Review > Restrict Editing > Formatting restrictions).

    This I could easily implement with:

    If ActiveDocument.EnforceStyle

    Additionally, I need to verify whether a password has been defined (which can be optionally done when you click "Yes, Start Enforcing Protection").

    However, I have not been able to find the corresponding property.

    If ActiveDocument.HasPassword

    returns true only for the password required to open the document, which is not my case.

    I do not want to modify the password, I just need to verify whether one is set. Any ideas?

    Thank you. 

    Friday, November 3, 2017 1:09 PM