Creating a formatted list box in a form

A

angiec50

I am trying to add a list box in a Word 2000 form that shows the options Red,
Amber and Green that when the user selects one of the options the colour of
the selection will also come up. i.e. if they choose Red, then the word
shows as Red.
I have tried adding a list box and an Active X-box which is what I beleive I
need to use but have no idea about VB editor. Can anyone help

Thanks
 
J

Jean-Guy Marcil

angiec50 said:
I am trying to add a list box in a Word 2000 form that shows the options Red,
Amber and Green that when the user selects one of the options the colour of
the selection will also come up. i.e. if they choose Red, then the word
shows as Red.
I have tried adding a list box and an Active X-box which is what I beleive I
need to use but have no idea about VB editor. Can anyone help

Can you describe in more details what you are trying to achieve, exactly?

Why would the word "Red" in the list box need to be red when it is selected?
I have a strange feeling I am not understanding what you are trying to do
here.
 
A

angiec50

Hi, yes basically I need to have the words coloured red or instead of the
word a drop down colour box that has the 3 colours as a drop down list. Its
for some very fussy Project Managers

Angie
 
G

Graham Mayor

If this is a protected form with three items in a dropdown form field
(dropdown1) then the following macro run on exit from that field will colour
the entries accordingly.

Sub OnExitDD1()
Dim bProtected As Boolean
Dim oFld As FormFields
If ActiveDocument.ProtectionType <> wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""
End If
Set oFld = ActiveDocument.FormFields
Select Case oFld("Dropdown1").Result
Case Is = "Red"
oFld("Dropdown1").Range.Font.Color = wdColorRed
Case Is = "Amber"
oFld("Dropdown1").Range.Font.Color = wdColorLightOrange
Case Is = "Green"
oFld("Dropdown1").Range.Font.Color = wdColorGreen
Case Else
'Do nothing
End Select
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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