Have to put a checked box into template

J

John

I have an application that open a work template (dot file) and insert some
value to each of bookmarks in the document. The the document is saved. There
is not any form and no any control for this application. Now I want to insert
a checked box into the template but don't know how to do so. What can I do
now is something like following,
oDoc.Bookmarks.Item("SomeBookMarkName").Range.Text = "X"

Can someone help to let me know how to insert a checked checkbox into the
bookmark of the template (I don't mind if you say to change either template
or code.

Thanks

Please cc to (e-mail address removed) if do post.

John
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Sm9obg==?=,
I have an application that open a work template (dot file) and insert some
value to each of bookmarks in the document. The the document is saved. There
is not any form and no any control for this application. Now I want to insert
a checked box into the template but don't know how to do so. What can I do
now is something like following,
oDoc.Bookmarks.Item("SomeBookMarkName").Range.Text = "X"

Can someone help to let me know how to insert a checked checkbox into the
bookmark of the template (I don't mind if you say to change either template
or code.
I take it a symbol would do? It needn't be a dynamic box that the user can
click?

Take a look in Insert/Symbol. If you find something you like, record inserting
it into a document in a macro to get the syntax you need.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

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

Charles Kenyon

If you need a dynamic (clickable) checkbox, there are a number of ways to
create and use clickable checkboxes in documents / templates. Some require
protected or locked forms, others do not. Take a look at the Checkbox
template available at
http://www.addbalance.com/word/download.htm#CheckboxAddIn for an exploration
of these. Some utilize code, others do not. Unless you have some other
reason for doing so, though, do _not_ use the checkbox from the Controls
Toolbox (an ActiveX control).
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
J

John

I figured it out how to do this. Since on the template, the bookmarks are on
the checkboxes. I can just simply code like
oDoc.formfield("SomeBookMarkName").checkbox.value=true

Then I saw my checkboxs on the document saved were checked.

John
 
C

Charles Kenyon

This tells me that you do have what Word calls an online form (as
distinguished from a form). For more about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles. You may also want to look at
http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm. While you can
manipulate checkboxes and other formfields using code, it is often far
simpler to simply protect the form and use these fields as they were
intended.

Hope this helps,
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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