View Single Post
  #5   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 Conditional Format Switch

As posted in microsoft.public.word.docmanagement, use:

{ IF { = { MERGEFIELD Address } - { MERGEFIELD Address } } = 0 { MERGEFIELD
Address \# "##'-'######"] } { MERGEFIELD Address } }

or whatever the field name is. Only if its contents are numeric will the
result of the subtraction will be zero.

--
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, originally posted via msnews.microsoft.com

"bushwood" wrote in message
...
More clarification... merge will encounter blank cells, text cells,
numeric
cells, text and numeric cells. We only want the switch on numeric only
cells. Should just pull all cell contents just fine if anything but
numeric
only if you can state a condition based on MERGFIELD \* charformat or
something? How do you put an IF statement to valuate format?
--
"Gambling is illegal @ Bushwood and I never slice."


"bushwood" wrote:

EIN Employer Identification Number. 12-3456789 format always numeric.
The
switch is \# ##'-'####### but suppress switch when encounter cell with
any
sort of alpha character... can you do this?

I understand the first few rows probelm can be solved with DDE as source
data ? Not really sure how to accomplish this, but I did read through
all of
the examples I could find here and over the web.
--
"Gambling is illegal @ Bushwood and I never slice."


"Peter Jamieson" wrote:

Can you spell out what
a. could be in this column
b. wat you mean by "EIN" ?

As background, there are (at least) two separate problems when using
Excel and a Mail Merge Data Source:
a. How do you ensure that your data reaches Word intact? (e.g., if
the
first 8 rows in your column contain numbers, then the chances are that
a
non-numeric text value in the column wi come across as 0)
b. even when the values reach Word intact, how do you decide that a
particular value needs to be formatted as (a) text, (b) numeric, (c)
date etc.


Peter Jamieson

http://tips.pjmsn.me.uk

On 28/04/2010 23:01, bushwood wrote:
How can you format a word 2007 mergefield a certain way depending on
the type
of value it encounters in your excel 2007 data source during the
mailmerge?
Basically, the merge will encounter blank record, EIN, or Address.
We want
the special format switch if encounter EIN, and then if not all
numeric just
pull the cell contents is fine.

Thanks for any help!
.