Help Needed with automating Check Boxes in Word 2K

T

tech1NJ

I have a protected document that offers 3 levels of services. Each service
has a checkbox next to it. I also have a list of several check points (with
checboxes next to each) that need to be done base on the level of service
selected. I would like to have the automation where by the check boxes next
to the check points get marked automatically only for the level of service
requested.

Example.

Service Types are GOLD SILVER BRONZE

GOLD = check points 1, 2, and 3
SILVER = check points 1, 2, and 4
BRONZE = check points 1 and 3 and 4

-- tech1NJ
 
D

Doug Robbins - Word MVP

As you probably only want one of GOLD, SILVER or BRONZE to be selected, it
would probably be better to use a DropDown type FormField - ServiceLevel
that contains those items. Then on exit from that field, you could run a
macro containing the following code, assuming that the check point boxes
have the bookmark names Check1, Check2, Check3 and Check4 assigned to them

With ActiveDocument
Select Case .FormFields("ServiceLevel").Result
Case "GOLD"
.FormFields("Check1").CheckBox.Value = True
.FormFields("Check2").CheckBox.Value = True
.FormFields("Check3").CheckBox.Value = True
.FormFields("Check4").CheckBox.Value = False
Case "SILVER"
.FormFields("Check1").CheckBox.Value = True
.FormFields("Check2").CheckBox.Value = True
.FormFields("Check3").CheckBox.Value = False
.FormFields("Check4").CheckBox.Value = True
Case "BRONZE"
.FormFields("Check1").CheckBox.Value = True
.FormFields("Check2").CheckBox.Value = False
.FormFields("Check3").CheckBox.Value = True
.FormFields("Check4").CheckBox.Value = True
End Select
End With


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 
T

tech1NJ

Dear Mr. Robins,

This is great informaton and will certainly be using it for my future
documents. Unfortunately, I can't use it on the current form. I was hoping to
get something along the lines that will help with the current needs. One more
piece of information that I forgot to mention was that I have a table in the
document that contains the information described below. Meaning that, the
services are in there own cells and all the check points are in another
single cell. What can you suggest on to get this accomplished?
Your help is greatly appreciated. Thanks in advance.
 
D

Doug Robbins - Word MVP

See the article "Making groups of Check Box Form Fields mutually exclusive
(so that they behave like radio buttons)†at:
http://www.word.mvps.org/FAQs/TblsFldsFms/ExclusiveFmFldChbxs.htm

Note, instead of using a Frame as mentioned in that article, if the Colour
Checkboxes are in the one row of the table, you can use the following code
in place of that shown in the article:

Dim oField As FormField

For Each oField In Selection.Rows(1).Range.FormFields
oField.CheckBox.Value = False
Next oField

Selection.FormFields(1).CheckBox.Value = True

End Sub

Then on exit from the "Gold" checkbox formfield, you will need to run a
macro containing the following code:

With ActiveDocument
If .FormFields("Gold").Checkbox.Value = True then
.FormFields("Check1").CheckBox.Value = True
.FormFields("Check2").CheckBox.Value = True
.FormFields("Check3").CheckBox.Value = True
.FormFields("Check4").CheckBox.Value = False
End if
End With

and similarly for "Silver" and "Bronze" changing the values assigned to
Check2, Check3 and Check4 as appropriate.




--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 

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