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 / November 2006

Tip: Looking for answers? Try searching our database.

Font Color and Font Dialog Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marty - 14 Nov 2006 19:48 GMT
I am trying to display the Font dialog and return the font color
selected by the User.  I get the result back correctly for some
colors, but not for others.  Here's my test macro.

MyFontColor is a static variable and if I run it once, select a color,
and then re-run it, the selected color is displayed SOMETIMES (e.g.,
if I select Red or Blue), but does NOT work if I select "Orange" or
"Rose", for example.

Sub ColorTest
Dim MyFontDlg As Dialog
Static MyFontColor
Dim res

Set MyFontDlg = Application.Dialogs(wdDialogFormatDefineStyleFont)
MyFontDlg.Color = MyFontColor
Dacapo:
res = MyFontDlg.Display
If res = 0 Then
 Exit Sub
Else
 MyFontColor = MyFontDlg.Color
End If

End Sub

Anyone have any ideas?

Thanks.
Anand.V.V.N - 15 Nov 2006 05:23 GMT
Hi Marty,
I think so if you use color.rgb might help i.e instead of

                           MyFontColor = MyFontDlg.Color
use

MyFontColor = MyFontDlg.Color.RGb

Might help you

Hope you found this useful.

Anand.

Signature

"Who will guard the guards?"

> I am trying to display the Font dialog and return the font color
> selected by the User.  I get the result back correctly for some
[quoted text clipped - 25 lines]
>
> Thanks.
Marty - 15 Nov 2006 15:03 GMT
>Hi Marty,
>I think so if you use color.rgb might help i.e instead of
[quoted text clipped - 9 lines]
>
>Anand.

Thank you very much for your suggestion.  This does, indeed, work.  

Marty
Anand.V.V.N - 15 Nov 2006 17:29 GMT
You welcome Marty I am glad that it  works
Signature

"Who will guard the guards?"

> >Hi Marty,
> >I think so if you use color.rgb might help i.e instead of
[quoted text clipped - 13 lines]
>
> Marty

Rate this thread:






 
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.