Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Lisa Lisa is offline
external usenet poster
 
Posts: 122
Default docvariable fields - force negative numbers to disred OR paren - h

How do you force a negative doc variable field (popualtesd via OLE from
another application) to either appear red in Word OR display as opena nd
close parenthesis? Standard formatting option froces two decimals which is
not aloowed, so am looking fro antoerh way.

Thanks!!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Lisa Lisa is offline
external usenet poster
 
Posts: 122
Default docvariable fields - force negative numbers to disred OR paren - h

Specifically, what would syntax be:

Now I am passign value as follows:

worddoc.variables(wordField).value = Cstr( Format (Cdbl (tmpItem.text) ,
"#,0.00") )

I suppose I would add another line under this (the Word doc has NOT been
updated yet), that (If value is negative Then)


worddoc.variables(wordField).font.color = wdColorRed

???? I know this syntax is wrong, but here is where I need help!

Thanks.


"Lisa" wrote:

How do you force a negative doc variable field (popualtesd via OLE from
another application) to either appear red in Word OR display as opena nd
close parenthesis? Standard formatting option froces two decimals which is
not aloowed, so am looking fro antoerh way.

Thanks!!

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default docvariable fields - force negative numbers to disred OR paren - h

You need a negative formatting switch on your Word field eg

\# "positive;negative;zero"

\# ",0.00;(,0.00);0.00"

and format each part as you want - see
http://www.gmayor.com/formatting_word_fields.htm Remove any charformat or
mergeformat switch

--

Graham Mayor - Word MVP

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




Lisa wrote:
Specifically, what would syntax be:

Now I am passign value as follows:

worddoc.variables(wordField).value = Cstr( Format (Cdbl
(tmpItem.text) , "#,0.00") )

I suppose I would add another line under this (the Word doc has NOT
been updated yet), that (If value is negative Then)


worddoc.variables(wordField).font.color = wdColorRed

???? I know this syntax is wrong, but here is where I need help!

Thanks.


"Lisa" wrote:

How do you force a negative doc variable field (popualtesd via OLE
from another application) to either appear red in Word OR display as
opena nd close parenthesis? Standard formatting option froces two
decimals which is not aloowed, so am looking fro antoerh way.

Thanks!!



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
how do I create negative numbers in Equation editor in.jester New Users 2 July 11th 07 02:17 AM
DocVariable fields adjacent to end of cell marks display wrongly John Nurick Tables 3 January 18th 07 11:51 AM
How to format negative numbers in Word tables Warrain Tables 9 March 17th 06 04:41 PM
How do I set up calculation fields in Word with negative numbers? Spacie Microsoft Word Help 1 August 18th 05 05:18 AM
Negative numbers at end of line Ruth Levinson Microsoft Word Help 10 February 28th 05 10:13 PM


All times are GMT +1. The time now is 11:32 PM.

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"