# Multiple field switches in mail merge



## Domski (Oct 5, 2007)

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


----------



## Domski (Oct 5, 2007)

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


----------



## Macropod (Oct 7, 2007)

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


----------



## Domski (Oct 8, 2007)

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


----------



## Macropod (Oct 8, 2007)

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


----------



## Domski (Oct 8, 2007)

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!!!


----------

