PDA

View Full Version : Check if password applied to Restrict formatting and editing



dinode
11-14-2017, 08:30 AM
Hi,

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

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.EnforceStyleAdditionally, 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.
The following code

If ActiveDocument.HasPasswordreturns 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?

I posted this question on the MSDN forum (https://social.msdn.microsoft.com/Forums/en-US/73da439e-4050-4145-9efe-29dd26dd7656/word-check-if-password-applied-to-restrict-formatting-and-editing?forum=isvvba) several days ago, but could not get any hint.

Thank you.

SamT
11-15-2017, 05:15 PM
Moderator bump