View Single Post
  #5   Report Post  
typewriterguy typewriterguy is offline
Junior Member
 
Posts: 0
Thumbs up

Graham, thank you! After inserting a less than operator after .Result, this worked perfectly!

Quote:
Originally Posted by Graham Mayor View Post
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