Click to See Complete Forum and Search --> : MS Word Security


Gammbro
September 14th, 2001, 02:08 PM
I have a project that creates a Word document, then it opens it within a web browser control.

I would like to add some security to these documents by placing a password on them.

How can I do this through vb code?

Cimperiali
September 17th, 2001, 06:38 AM
when you save your document, use saveas method.
You may add a Password (to open, user will be prompt to insert password) or a
writepassword (to save changes to original doc, you will have to provide a
password)
sintax:
wapp.Documents("yourdoc").SaveAs FileName, fileformat, lockComments, Password, addtorecent, WritePassword

Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.

The Rater