Dropdown "Conditional Formatting"

O

Oscar Trevino

Hey you, solution searchers and solution gurus.

Using Word 2003:
1. I want to assign a different font color for each of the four values in my
dropdown field.

2. I also want to assign a different font for one of the four values in my
dropdown field.

3. I want the values to display "correctly" in the dropdown list; the values
currently don't display "correctly" until they're "selected" - as three of
four values are formatted with the Windings3 font.

At this point, items one and two, above, are the "must haves"; item three,
above, is a "should have".

Value1: -Select One- | Font:Arial; Color:Black
Value2: <Up Arrow> | Font:Windings3 (Char Code:0xE3); Color:Green
Value3: <Down Arrow> | Font:Wingdings3 (Char Code:0xE4); Color:Red
Value4: <Right Arrow> | Font:Wingdings3 (Char Code:0xE2); Color:Yellow

Thanks!
 
J

Jonathan West

Oscar Trevino said:
Hey you, solution searchers and solution gurus.

Using Word 2003:
1. I want to assign a different font color for each of the four values in
my
dropdown field.

Can only be done with a macro triggered on exit from the field
2. I also want to assign a different font for one of the four values in my
dropdown field.

Can only be done with a macro triggered on exit from the field
3. I want the values to display "correctly" in the dropdown list; the
values
currently don't display "correctly" until they're "selected" - as three of
four values are formatted with the Windings3 font.

Impossible. The dropdown field simply doesn't support this.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
K

Klaus Linke

3. I want the values to display "correctly" in the dropdown list; the
Impossible. The dropdown field simply doesn't support this.

Wingdings 3 is mostly arrows. Symbol fonts such as Wingdings 3 are better
avoided, generally.
Unicode has lots and lots of arrows, but the default font for menus in
WinXP, Tahoma, doesn't contain those characters.
You'd have to change the font for menus to some font with more
characters/arrows, say, Arial.
Hopefully, Windows Vista will use fonts with a richer set of Unicode
characters by default.

Regards,
Klaus
 
O

Oscar Trevino

Thanks for the reality check, on #3.

To nudge me in the right direction, would anyone be able to suggest syntax
to manipulate the objects, properties, methods, etc. involved?

How about some code? :)
 
G

Greg

Something like:

Sub DD1Exit()
Dim oFormFld As FormField
Set oFormFld = ActiveDocument.FormFields("DD1")
ActiveDocument.Unprotect
Select Case oFormFld.Result
Case "Red"
oFormFld.Range.Font.Color = wdColorRed
Case "Blue"
oFormFld.Range.Font.Color = wdColorBlue
oFormFld.Range.Font.Name = "Arial"
'Case ...
End Select
ActiveDocument.Protect wdAllowOnlyFormFields, True
End Sub
 
K

Klaus Linke

Hi Oscar,

The font used in the drop down menu is set in Windows (Display properties >
Appearance > Advanced... > Menu, the default being "Tahoma").
I wouldn't change it in a VBA macro, even if you might be able do it in
principle.

Greetings,
Klaus
 
O

Oscar Trevino

Using this code, I get a "Run Time Error '5941:The Requested member of the
collection does not exist.

Maybe I need a stronger nudge
 
O

Oscar Trevino

Using this code, I get a "Run Time Error '5941:The Requested member of the
collection does not exist.

Maybe I need a stronger nudge
 
G

Greg Maxey

Oscar,

Unprotect your form, doubleclick the form field and make sure the bookmark
name of the formfield is "DD1"

Do that, or change

Set oFormFld = ActiveDocument.FormFields("DD1") to reflect the preferred
name of the formfield.
 

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