Form Fields

M

Mark Baird

I am using the following code to protect a form. Is it possible that
protecting a form can set a checkbox to true?

ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True,
Password:=FORM_PASSWORD

Mark Baird
 
D

Doug Robbins - Word MVP

Hi Mark,

Include the command

ActiveDocument.FormFields("Check1").CheckBox.Value = True

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
M

Mark Baird

Sorry for not clarifying but I have had reports from users of
checkboxes being set to true without any user intervention.

When the form is loaded a global addin is also loaded. The form is
temporarily "unprotected" so that a menu can be built. Once the menu
is built the form is "reprotected" with a password.

Given that my question is: are there any known bugs that will
mysteriously set a checkbox to true.

Mark
 
D

Doug Robbins - Word MVP

Hi Mark,

Not that I am aware of, but you could include the following in your code to
ensure that it is false immediately after the document is protected:

ActiveDocument.FormFields("Check1").CheckBox.Value = False

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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