how to make a document password protected on closing

D

dr.k

Hello - I hope this is the right forum. I am not a programmer but think I need a programmer's help for this. I would like a Word form to be password protected upon closing. This is to allow a survey result to remain confidential until opened by the correct person. Security level doesn't need to be very high. Is there a macro that can do this? thanks.
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < dr.k > écrivait :
In this message, < dr.k > wrote:

|| Hello - I hope this is the right forum. I am not a programmer but think
I need a programmer's
|| help for this. I would like a Word form to be password protected upon
closing. This is to
|| allow a survey result to remain confidential until opened by the correct
person. Security level
|| doesn't need to be very high. Is there a macro that can do this?
thanks.

At its simplest expression, put this code in the ThisDocument module:

'_______________________________________
Private Sub Document_Close()

ActiveDocument.Password = "123"

End Sub
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top