Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default Large dollar amount switch

In one of my merge documents, I use the \*DollarText field switch to format
the dollar amount in words. It has worked fine until now, but we just got a
dollar amount over $1 million and I'm getting an error because the number is
too high. Is there a fix for this?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Large dollar amount switch

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better than I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we just got
a
dollar amount over $1 million and I'm getting an error because the number
is
too high. Is there a fix for this?



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default Large dollar amount switch

Do I paste all of this into the Mergefield or is this code I have to set up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better than I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we just got
a
dollar amount over $1 million and I'm getting an error because the number
is
too high. Is there a fix for this?




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Large dollar amount switch

it would replace whatever merge field codes you are using now in your Word
document.

In essence, enter the {} pairs into your document using ctrl-F9. Type
everything else in the usual way. Use Alt-F9 to toggle between "field codes"
view and "field results" view. Select the field and press F9 to update the
results.

Peter Jamieson

"Todd K." wrote in message
...
Do I paste all of this into the Mergefield or is this code I have to set
up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better than
I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we just
got
a
dollar amount over $1 million and I'm getting an error because the
number
is
too high. Is there a fix for this?






  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default Large dollar amount switch

I tried it and I'm getting a result of 0.0, but I noticed two inconsistencies
in your code:
1) you have one too many right brackets "}"
2) on your "SET m" line, there are two closing brackets without opening
brackets "))"


"Peter Jamieson" wrote:

it would replace whatever merge field codes you are using now in your Word
document.

In essence, enter the {} pairs into your document using ctrl-F9. Type
everything else in the usual way. Use Alt-F9 to toggle between "field codes"
view and "field results" view. Select the field and press F9 to update the
results.

Peter Jamieson

"Todd K." wrote in message
...
Do I paste all of this into the Mergefield or is this code I have to set
up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better than
I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we just
got
a
dollar amount over $1 million and I'm getting an error because the
number
is
too high. Is there a fix for this?








  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Large dollar amount switch

The correct field construction is:

{ SET x { MERGEFIELD mylargenumber }}{ SET r { =MOD(x,1000000) }}
{ SET m { =INT((x-r)/1000000) }}
{ IF { m } = 0 "" "{ m \*Cardtext } million "}{ r \Cardtext }


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Todd K." wrote in message
...
I tried it and I'm getting a result of 0.0, but I noticed two
inconsistencies
in your code:
1) you have one too many right brackets "}"
2) on your "SET m" line, there are two closing brackets without opening
brackets "))"


"Peter Jamieson" wrote:

it would replace whatever merge field codes you are using now in your
Word
document.

In essence, enter the {} pairs into your document using ctrl-F9. Type
everything else in the usual way. Use Alt-F9 to toggle between "field
codes"
view and "field results" view. Select the field and press F9 to update
the
results.

Peter Jamieson

"Todd K." wrote in message
...
Do I paste all of this into the Mergefield or is this code I have to
set
up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better
than
I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we
just
got
a
dollar amount over $1 million and I'm getting an error because the
number
is
too high. Is there a fix for this?








  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Large dollar amount switch

Yes, there should also be a * before the second "Cardtext". Try:

{ SET x { MERGEFIELD mylargenumber }
}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT((x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million " }{ r \*Cardtext }

Other than that, it seems OK here - what values do you have in your
"mylargenumber" ?

What is the result of { x } ?

Peter Jamieson

"Todd K." wrote in message
...
I tried it and I'm getting a result of 0.0, but I noticed two
inconsistencies
in your code:
1) you have one too many right brackets "}"
2) on your "SET m" line, there are two closing brackets without opening
brackets "))"


"Peter Jamieson" wrote:

it would replace whatever merge field codes you are using now in your
Word
document.

In essence, enter the {} pairs into your document using ctrl-F9. Type
everything else in the usual way. Use Alt-F9 to toggle between "field
codes"
view and "field results" view. Select the field and press F9 to update
the
results.

Peter Jamieson

"Todd K." wrote in message
...
Do I paste all of this into the Mergefield or is this code I have to
set
up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better
than
I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we
just
got
a
dollar amount over $1 million and I'm getting an error because the
number
is
too high. Is there a fix for this?







  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Large dollar amount switch

It is very easy to make minor mistakes in transposing fields to text strings
but what I suspect Peter really meant was

{ SET x { Mergefield MyLargeNumber }
}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT((x-r)/1000000) }
}{ IF{ m } = 0 "{=INT({ r })\*Cardtext }" "{ =INT({ m }) \*Cardtext }
million " }


This works for me (for integers). To aid the copying of field construction
to text use the macro at http://www.gmayor.com/export_field.htm. That way
you don't get the mistakes

If you have decimals with the numbers (or these are currency amounts) then
further calculations will be required.- see the section formatting cash
amounts in words at http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

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



Todd K. wrote:
I tried it and I'm getting a result of 0.0, but I noticed two
inconsistencies in your code:
1) you have one too many right brackets "}"
2) on your "SET m" line, there are two closing brackets without
opening brackets "))"


"Peter Jamieson" wrote:

it would replace whatever merge field codes you are using now in
your Word document.

In essence, enter the {} pairs into your document using ctrl-F9. Type
everything else in the usual way. Use Alt-F9 to toggle between
"field codes" view and "field results" view. Select the field and
press F9 to update the results.

Peter Jamieson

"Todd K." wrote in message
...
Do I paste all of this into the Mergefield or is this code I have
to set up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations
better than I
have.

But you can modify the technique anyway to separate out each digit
and convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch
to format
the dollar amount in words. It has worked fine until now, but we
just got
a
dollar amount over $1 million and I'm getting an error because the
number
is
too high. Is there a fix for this?



  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Todd K. Todd K. is offline
external usenet poster
 
Posts: 27
Default Large dollar amount switch

Wow, thank you all so much. I actually made a couple of other changes, as
this is for dollars and needed to be in all capitals, so my final code looks
like this:

{ SET x { MERGEFIELD mylargenumber }
}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT((x-r)/1000000) }
}{ IF { m } = 0 "" "{ m \*Cardtext\*Upper } MILLION" }{ r
\*Dollartext\*Upper }

But it works great. Kudos to you.

"Peter Jamieson" wrote:

Yes, there should also be a * before the second "Cardtext". Try:

{ SET x { MERGEFIELD mylargenumber }
}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT((x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million " }{ r \*Cardtext }

Other than that, it seems OK here - what values do you have in your
"mylargenumber" ?

What is the result of { x } ?

Peter Jamieson

"Todd K." wrote in message
...
I tried it and I'm getting a result of 0.0, but I noticed two
inconsistencies
in your code:
1) you have one too many right brackets "}"
2) on your "SET m" line, there are two closing brackets without opening
brackets "))"


"Peter Jamieson" wrote:

it would replace whatever merge field codes you are using now in your
Word
document.

In essence, enter the {} pairs into your document using ctrl-F9. Type
everything else in the usual way. Use Alt-F9 to toggle between "field
codes"
view and "field results" view. Select the field and press F9 to update
the
results.

Peter Jamieson

"Todd K." wrote in message
...
Do I paste all of this into the Mergefield or is this code I have to
set
up
elsewhere?

"Peter Jamieson" wrote:

In the U.S. you can probably use

{ SET x { MERGEFIELD mylargenumber }



}{ SET r { =MOD(x,1000000) }
}{ SET m { =INT(x-r)/1000000)) }
}{ IF { m } = 0 "" "{ m \*Cardtext } million }" }{ r \Cardtext }

to go a bit larger. You might need to check the calculations better
than
I
have.

But you can modify the technique anyway to separate out each digit and
convert it to a word.

Peter Jamieson
"Todd K." wrote in message
...
In one of my merge documents, I use the \*DollarText field switch to
format
the dollar amount in words. It has worked fine until now, but we
just
got
a
dollar amount over $1 million and I'm getting an error because the
number
is
too high. Is there a fix for this?








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
right justify dollar amounts Jason.Bradley Mailmerge 3 December 18th 06 06:12 PM
Dollar Amount Conversion J Mowad Microsoft Word Help 4 September 10th 06 11:32 PM
Dollar sign lols9 Microsoft Word Help 2 July 22nd 06 05:55 PM
Method for displaying dollar amount as written on bank check samandmonty Microsoft Word Help 5 May 11th 05 10:54 PM
dollar symbols norml1s Microsoft Word Help 3 January 6th 05 03:21 AM


All times are GMT +1. The time now is 08:20 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"