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 / Document Management / May 2008

Tip: Looking for answers? Try searching our database.

Changing Font Color in Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lisa Mazzanti - 16 May 2008 14:17 GMT
I am creating a form in Word. When a negative number is entered in the text
form field I want the negative number to be in red instead of a parenthesis.

Can this be done?  
Signature

L. Mazzanti

Robert M. Franz (RMF) - 29 May 2008 12:46 GMT
Hello Lisa

> I am creating a form in Word. When a negative number is entered in the text
> form field I want the negative number to be in red instead of a parenthesis.

yes, easily: in Excel! :-)

In Word, you'll probably need an on-exit macro assigned to the field
(that changes the color).

HTH
Robert
Signature

 /"\  ASCII Ribbon Campaign | MSFT |
 \ /                        |  MVP |     Scientific Reports
  X        Against HTML     |  for |         with Word?
 / \     in e-mail & news   | Word | http://www.masteringword.eu/

Graham Mayor - 29 May 2008 15:41 GMT
Assuming the field bookmark name is "Text1" then the following run on exit
from the field will format negative numbers in red.

Sub NegFormat()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
If oFld("Text1").Result < 1 Then
   oFld("Text1").Range.Font.Color = wdColorRed
Else
   oFld("Text1").Range.Font.Color = wdColorBlack
End If
End Sub

For a numeric field entry type set the field format to 0.00 or 0

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hello Lisa
>
[quoted text clipped - 9 lines]
> HTH
> Robert
Robert M. Franz (RMF) - 29 May 2008 22:57 GMT
Hi Graham

> Assuming the field bookmark name is "Text1" then the following run on exit
> from the field will format negative numbers in red.
[quoted text clipped - 3 lines]
> Set oFld = ActiveDocument.FormFields
> If oFld("Text1").Result < 1 Then

< 0 ?

Greetinx
Robert
ps: no, I didn't test it! :-)
Signature

 /"\  ASCII Ribbon Campaign | MSFT |
 \ /                        |  MVP |     Scientific Reports
  X        Against HTML     |  for |         with Word?
 / \     in e-mail & news   | Word | http://www.masteringword.eu/

 
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.