Forum Discussion

alanwads's avatar
alanwads
Copper Contributor
Sep 23, 2021

VBA code incorrectly reporting a protected document as unprotected

I have a Word document with password protection to control the use and editing of styles within it. When I run the following VBA code to remove this protection;    

 

ActiveDocument.Unprotect Password:="myPassword"

 

I get the error message below, saying the doc I am using the above on is unprotected, which is definitely not the case, it is indeed protected.

 

Could somebody please let me know if/what I'm doing wrong here? MANY THANKS for any help.

 

Alan

 

No RepliesBe the first to reply

Resources