Anyone know how to save the active document as read-only using VB? ActiveDocument.ReadOnly = True doesn't work because the document is already open.
Thanks,
Dan
Actually, I figured out a way to do it:
ActiveDocument.WritePassword = "your_password_here"
This will then cause the document to open up with three options: open (to be able to edit), read-only, and cancel. To be able to open the file, you have to enter the password.
Of course, make sure to protect your code otherwise, anyone could just look at the code and see the password to edit the document.
Thanks,
Dan
Actually, I figured out a way to do it:
ActiveDocument.WritePassword = "your_password_here"
This will then cause the document to open up with three options: open (to be able to edit), read-only, and cancel. To be able to open the file, you have to enter the password.
Of course, make sure to protect your code otherwise, anyone could just look at the code and see the password to edit the document.