protecting document - word'97

N

Nikhil Patel

Hi all,
I am writing a VB application for Word 97. The application merges several
prewritten Word documents based on the user selection. For example, if the
user selects to generate certain type of document in the application, I
would like to generate a new document at runtime by merging DoumentA.doc ,
DocumentB.doc and DocumentC and display it to the user. I can do this
without any problem. But now I need to password protect the contents coming
from the DocumentC.doc in the new document. How can I do this?
Thanks.
-Nikhil
 
J

Jonathan West

Nikhil Patel said:
Hi all,
I am writing a VB application for Word 97. The application merges
several prewritten Word documents based on the user selection. For
example, if the user selects to generate certain type of document in the
application, I would like to generate a new document at runtime by merging
DoumentA.doc , DocumentB.doc and DocumentC and display it to the user. I
can do this without any problem. But now I need to password protect the
contents coming from the DocumentC.doc in the new document. How can I do
this?
Thanks.
-Nikhil

What is the password protection supposted to prevent?
 
N

Nikhil Patel

Hi Jonathan,
Thanks for your reply. I need to prevent users from editing the contents
coming from DocumentC but allow them to edit contents coming from DocumentA
and DocumentB.
Thanks.
 
J

Jonathan West

Nikhil Patel said:
Hi Jonathan,
Thanks for your reply. I need to prevent users from editing the
contents coming from DocumentC but allow them to edit contents coming from
DocumentA and DocumentB.
Thanks.

Then insert the contents of DocumentC into a separate Section within the
document, and then protect that section for forms.

But be aware that this is not a security measure, it is only proof against
accidental modification. Inserting the protected document into a blank
document using the Insert File feature will cause all the protection to be
stripped off.
 
N

Nikhil Patel

Hi Jonathan,
I tried the following line:
sectionDest.ProtectedForForms = True

But it wtill allows me to edit the section.

Thanks.
Nikhil
 
J

Jonathan West

Nikhil Patel said:
Hi Jonathan,
I tried the following line:
sectionDest.ProtectedForForms = True

But it wtill allows me to edit the section.

You need then to protect the document using this line of code


ActiveDocument.Protect Password:="", NoReset:=False, Type:= _
wdAllowOnlyFormFields
 

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