Form protection problems

M

MS News

VBA gurus:

I am so confused. I have a form (regular document, not a template) that
opens in a protected state, so that only the fields are available for
editing. This is fine except some of the fields need to be bolded. I created
a toolbar for this document that opens with the document. The button on the
toolbar unprotects the document, bolds the highlighted work & then
re-protects the document.

Sub Makebold()
ActiveDocument.Unprotect Password:="xxxx"
With Selection.Font
.Bold = True
End With
ActiveDocument.Protect (wdAllowOnlyFormFields), NoReset:=True,
Password:="xxxx"
End Sub

Several problems are occurring with this need.

1. Upon opening the document, the toolbar is grayed out instead of being
available.
2. Now that the unprotect with the password has been run, a user can choose
unprotect form the tools menu & mess with the entire document any time they
want. Why isn't it asking for a password anymore? I really need to fix this
problem!

Any help is greatly appreciated.

KS
 
C

Cindy Meister -WordMVP-

Hi MS,
1. Upon opening the document, the toolbar is grayed out instead of being
available.
Did you use any fields from the Control Toolbox?

I also think this is formulated incorrectly. Recheck the source you copied
this from:
ActiveDocument.Sections _
(1).PageSetup.DifferentFirstPageHeaderFooter = True
2. Now that the unprotect with the password has been run, a user can choose
unprotect form the tools menu & mess with the entire document any time they
want. Why isn't it asking for a password anymore? I really need to fix this
problem!


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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