Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Lisa Mazzanti Lisa Mazzanti is offline
external usenet poster
 
Posts: 3
Default Changing Font Color in Form

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?
--
L. Mazzanti
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Robert M. Franz (RMF) Robert M. Franz (RMF) is offline
external usenet poster
 
Posts: 1,741
Default Changing Font Color in Form

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
--
/"\ ASCII Ribbon Campaign | MSFT |
\ / | MVP | Scientific Reports
X Against HTML | for | with Word?
/ \ in e-mail & news | Word | http://www.masteringword.eu/
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Changing Font Color in Form

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



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Robert M. Franz (RMF) Robert M. Franz (RMF) is offline
external usenet poster
 
Posts: 1,741
Default Changing Font Color in Form

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/
  #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
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
changing font color of file folders in Word 2003 Wendy Microsoft Word Help 1 November 28th 07 02:05 AM
Changing font and background color of Comments in Word 2007 Deb RW Microsoft Word Help 0 November 1st 07 09:13 PM
Table of Contents - changing the font color macropod New Users 1 April 22nd 06 11:53 AM
changing my automatic font color noooneh Microsoft Word Help 1 May 1st 05 04:27 PM
changing font size and color Geoff Barrett Microsoft Word Help 16 March 28th 05 03:17 PM


All times are GMT +1. The time now is 03:34 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"