Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Robert M. Franz (RMF) wrote: Hello Lisa Lisa Mazzanti wrote: 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 |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Hi Graham
Graham Mayor wrote: 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 0 ? Greetinx Robert ps: no, I didn't test it! :-) -- /"\ ASCII Ribbon Campaign | MSFT | \ / | MVP | Scientific Reports X Against HTML | for | with Word? / \ in e-mail & news | Word | http://www.masteringword.eu/ |
#3
![]() |
|||
|
|||
![]()
Graham, thank you! After inserting a less than operator after .Result, this worked perfectly!
![]() Quote:
|
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
changing font color of file folders in Word 2003 | Microsoft Word Help | |||
Changing font and background color of Comments in Word 2007 | Microsoft Word Help | |||
Table of Contents - changing the font color | New Users | |||
changing my automatic font color | Microsoft Word Help | |||
changing font size and color | Microsoft Word Help |