Automatic Document Template & Userform checkbox

L

LindaL

I have designed a document template and userform. On my userform I have
placed several text boxes and a "chkHistory1" checkbox. There are several
other checkboxes also but I need help on 1 so I can do the rest. I have on
my document template a checkbox with a bookmark named "History1". When I
finish entering information and have placed a check in the checkbox
"chkHistory1" on the userform then click OK everything prints on my new
document except my checkbox. I am relatively new to VB and I need some
help. I have tried several different codes and I'm lost.
 
S

Srini

ActiveDocument.Bookmarks("History1").Range.Text = chkHistory1.caption

insert this logic before adding textbox bookamrks.

Thanks
Srini
 
L

LindaL

Is my form reading the checkbox I have on it as text? I inserted this into
my codes and when I click my OK button and check my document where the
checkmark should be in my checkbox area it has inserted History1? I have
checkboxes on my template as well as my form. Again I want to apologize for
being so VB illiterate.
 
S

Srini

Hi,

what i understood is..
u have a checkbox with a caption on userform and template is having a
checkbox with a bookmark
when u check the checkbox on userform and click ok, the caption of the
checkbox should be inserted as bookmark on template and the checkbox
shud be checked. is this correct?
 
L

LindaL

When I place a checkmark in the checkbox on my userform I want the checkbox
on the template to have a checkmark in it also. I have no caption on the
checkbox, I used a label "History". Next to this I have another checkbox
with a label "Current". This way the person filling out the form can check
if they have had a "history of a disease" or "currently have the disease" or
maybe even both. I hope this explanation helps.
I used this website to help me build my form.

http://www.fontstuff.com/vba/vbatut09pfv.htm
 
K

Kodeworks

LindaL,

Try this

ThisDocument.FormFields("History1").CheckBox.Value = chkHistory1.Value

We're assuming here that the checkbox on the document - "History1" - is
a form field checkbox you insert from the Forms toolbar. It gets more
complicated if you're using the checkbox from the Control Toolbox
toolbar.

Sunil Jadwani
Kodeworks - Business Automation Solutions
www.kodeworks.com
 

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