>I am using createobject to create an instance of Word, into which I'm sending data from VFP5. This document is printed and saved by the user. However the user should be able to view these documents at a later date, but should not be able to edit them.
>
>Does anyone know the syntax for programatically setting the password option in the Word document itself, as I create the Word object.
>
>These documents are of a highly sensitive nature, so it is important to protect these documents from other people outside of the company, not just the users.
>
>Any help on this matter would be much appreciated.
>
>regards
>
>Derek
Hi, the Word document object has a WritePassword property, so
loDoc.WritePassword = "whatever"
before you save the document should work.