linking 2 drop down boxes, not the cascading way

G

George

Hi
Is it possible in Word 2003 to create two linked drop down boxes in a way
that one or more items in dropdown1 could be linked to one item in dropdown2?
For example, I have in dropdown1: cat, dog, crocodile, lizard, ant, fly. In
dropdown2 I have: mammal, reptile, insect. I wonder if it's possible in Word
to make "mammal" show automatically in dropdown2 when choosing "cat" or "dog"
in dropdown1, and "reptile" in droptown2 when choosing "crocodile" or
"lizard", etc.

Maybe it's not necessary to have a dropdown2, since the user chooses nothing
from it. Maybe something else can do the job.

Is all of this possible in Word?
 
G

Greg Maxey

George and others who might be interested,

If you decided to convert this project to Word2007 using the new
ContentControls you could use something like this. The macro assumes the
dropdown CC is tagged "CC1" and the plain text CC is tagged "CC2" with its
content locked.

Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel
As Boolean)
Select Case CC.Tag
Case "CC1"
ActiveDocument.SelectContentControlsByTag("CC2").Item(1).LockContents =
False
Select Case CC.Range.Text
Case Is = "Cat", "Dog"
ActiveDocument.SelectContentControlsByTag("CC2").Item(1).Range.Text
= "Mammal"
Case Is = "Ant", "Fly"
ActiveDocument.SelectContentControlsByTag("CC2").Item(1).Range.Text
= "Insect"
Case Is = "Crocodile", "Lizard"
ActiveDocument.SelectContentControlsByTag("CC2").Item(1).Range.Text
= "Reptile"
End Select
ActiveDocument.SelectContentControlsByTag("CC2").Item(1).LockContents
= True
End Select
End Sub
 
G

George

Thanks Greg. I usually check your site before posting here. Although I had
seen that page, I wasn't sure whether the second formfield should be a
dropdown or something else I don't know what. So I had to ask.

Thanks for the valuable info.
 

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