Multiple field switches in mail merge

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Hi,

Need a quick bit of help.

Been asked to help set up a load of mail merges. I've used field switches to format data before but this time I

I want to format the some fields as currency and conditionally insert a comma infront of it should the field be populated.

However:

This works: { MERGEFIELD Amount2\# £#,###.00 }

as does this: { MERGEFIELD Amount2\b ", " }

but this doesn't: { MERGEFIELD Amount2\# £#,###.00 \b ", " }

Are you not allowed to insert more than one switch within a field?

Can anyone please help as I've got a very tight deadline on this. Will be desperatey Googling in the mean time.

Cheers,

Dom
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Okay,

I've pulled most of my hair out and changed approach slightly.

I've now got this:

{ IF { MERGEFIELD Amount2 } > 0 ", {MERGEFIELD Amount2 \# £#,###.00}" ""}

It seems to work even if it's a pain to set up.

I'd still be interested to know if you are limited to one switch for future reference.

Dom
 
Upvote 0
Hi Domski,

Try:
{MERGEFIELD Amount2\# "£,0.00;;"}
With numeric fields, you can specify three arguments, for displaying +ve, -ve and 0 values, respectively. Each argument is separated by a semi-colon. Leaving the argument empty suppresses the output for that argument.

You can also include text in the arguments. Check out my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party
for some examples of this and lots of other interesting maths-related things you can get up to with Word fields.

Cheers
 
Upvote 0
Hi,

Thanks for the suggestion although I don't think it addresses the problem I have.

As I said the formatting works fine on it's own, it's only when I try and add the additional switch to conditionally insert the comma that I get problems.

Will have a look at the links when I get a chance.

Dom
 
Upvote 0
Hi Domski,

You mean that comma ahead of the of the mergefield? That's an odd requirement but, if that's what you're after, in addition to the thousands separator, try:
{MERGEFIELD Amount2 \# "', '£,0.00;;"}

Cheers
 
Upvote 0
Not that odd I don't think, but there again I don't use Word much.

Cheers for the help anyway. Hope you're not too gutted about Saturday's result!!! At least the Kiwi's are out as well. Was in NZ earlier this year and they were talking it up so much about how they were going to win it this time. Laugh, I nearly cried!!!
 
Upvote 0

Forum statistics

Threads
1,225,354
Messages
6,184,458
Members
453,233
Latest member
bgmb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top