Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Send Form Check Box to Document via VBA

Posted on 2009-07-13
5
Medium Priority
?
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

722 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