Send Form Check Box to Document via VBA

I want to insert checked!! check boxes into a Word Form.
How can I do this using VBA and {formcheckbox}. btw: Not using the Insert Checkbox-Button inserts a Field where I cannot set properties for the box later. It says that this field was not inserted by the button ??! What kind of document-automation limitation is that - I can't grab any sense of it.
What can I do?
Chris
chriswiesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
It isn't clear exactly what you are doing, but the InsertCheckBox Sub in the snippet should insert a checkbox and set its value. The CallInsertCheckBox Sub shows the usage.
Sub CallInsertCheckBox()
    InsertCheckBox ActiveDocument.Bookmarks("\EndOfDoc").Range
End Sub
 
Sub InsertCheckBox(rng As Range)
    Dim ffld As FormField
    Set ffld = ActiveDocument.FormFields.Add(rng, wdFieldFormCheckBox)
    ffld.CheckBox.Value = True
End Sub

Open in new window

0
chriswiesAuthor Commented:
hm, ok, I get it.
The way I do it now via automation is by .insertfield because users can configure their fields for the text.
Wanting to use .insertfield you probably say that it is impossible, right?
Chris
0
GrahamSkanRetiredCommented:
I'm not sure that I understand. I don't think that there is an InsertField method
0
chriswiesAuthor Commented:
sorry, i recalled from memory. It is VBA "fields.add ".
Chris
0
GrahamSkanRetiredCommented:
I cannot find a way of adding a FormField to the Fields collection. It mus be added to the FormFields collection.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.