Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Dropdown "Conditional Formatting"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Oscar Trevino - 17 Feb 2006 06:45 GMT
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!
Jonathan West - 17 Feb 2006 09:03 GMT
> 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.

Signature

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 

Klaus Linke - 17 Feb 2006 14:06 GMT
>> 3. I want the values to display "correctly" in the dropdown list; the
>> values
[quoted text clipped - 3 lines]
>
> 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
Oscar Trevino - 17 Feb 2006 14:51 GMT
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? :)

> > Hey you, solution searchers and solution gurus.
> >
[quoted text clipped - 16 lines]
>
> Impossible. The dropdown field simply doesn't support this.
Greg - 17 Feb 2006 15:07 GMT
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
Oscar Trevino - 22 Feb 2006 22:25 GMT
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

> Something like:
>
[quoted text clipped - 12 lines]
> ActiveDocument.Protect wdAllowOnlyFormFields, True
> End Sub
Greg Maxey - 22 Feb 2006 22:54 GMT
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.

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Using this code, I get a "Run Time Error '5941:The Requested member
> of the collection does not exist.
[quoted text clipped - 17 lines]
>> ActiveDocument.Protect wdAllowOnlyFormFields, True
>> End Sub
Klaus Linke - 17 Feb 2006 20:54 GMT
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

> Thanks for the reality check, on #3.
>
[quoted text clipped - 26 lines]
>>
>> Impossible. The dropdown field simply doesn't support this.
Oscar Trevino - 22 Feb 2006 22:49 GMT
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

> Something like:
>
[quoted text clipped - 12 lines]
> ActiveDocument.Protect wdAllowOnlyFormFields, True
> End Sub

> Hi Oscar,
>
[quoted text clipped - 36 lines]
> >>
> >> Impossible. The dropdown field simply doesn't support this.
Greg Maxey - 22 Feb 2006 22:56 GMT
Change the dropdown field bookmark name to "DD1"

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Using this code, I get a "Run Time Error '5941:The Requested member
> of the collection does not exist.
[quoted text clipped - 68 lines]
>>>> Keep your VBA code safe, sign the ClassicVB petition
>>>> www.classicvb.org 
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.