Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Send Form Check Box to Document via VBA

Posted on 2009-07-13
5
Medium Priority
?
375 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:chriswies
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 24838875
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
 

Author Comment

by:chriswies
ID: 24838903
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 24839496
I'm not sure that I understand. I don't think that there is an InsertField method
0
 

Author Comment

by:chriswies
ID: 24839559
sorry, i recalled from memory. It is VBA "fields.add ".
Chris
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 24840110
I cannot find a way of adding a FormField to the Fields collection. It mus be added to the FormFields collection.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Lost Word File? Eagerly, need it back? Read ahead; this File Recovery guide is for you.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question