Printing zeros when PO Box is unavailable

J

Janiskdot

When I preview my letters using the mail merge wizard, I have 0's appearing when PO Box is unavailable. I do not know how to get the wizard to allow me to skip a line in the address if the PO Box doesn't have something greater than 0. I tried the If Then Else but how do I specifiy a blank line if a 0 is found? My data source is in an Excel spreadsheet and is blank.
 
P

Peter Jamieson

I tried the If Then Else but how do I specifiy a blank line if a 0 is
found?

You can just put a paragraph mark (in the usual way) in the result, e.g.
instead of

{ IF { MERGEFIELD "PO Box" } = 0 "abc" "{ MERGEFIELD "PO Box" }" }

use

{ IF { MERGEFIELD "PO Box" } = 0 "
abc" "{ MERGEFIELD "PO Box" }" }

or whatever.

--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

Janiskdot said:
When I preview my letters using the mail merge wizard, I have 0's
appearing when PO Box is unavailable. I do not know how to get the wizard
to allow me to skip a line in the address if the PO Box doesn't have
something greater than 0. I tried the If Then Else but how do I specifiy a
blank line if a 0 is found? My data source is in an Excel spreadsheet and
is blank.
 
J

Janiskdot

I still don't understand how this is to be done. I can not see a difference between what you listed as something I might use and what you think I should use. What does 'abc' stand for in your example?

What I need is

if PO BOX = 0 the
print the next line (city,state,zip
els
print PO BO
endi

Thank you for your response
 
P

Peter Jamieson

I still don't understand how this is to be done. I can not see a
difference between what
you listed as something I might use and what you think I should use.
What does 'abc' stand for in your example?

Ignore the "abc" for now. Just remove it from the examples. The difference
between my two samples is that in one of them, the " after the 0 is the last
character of the first line, i.e. in Word there would be a paragraph mark
after it. But in any case...
What I need is:

if PO BOX = 0 then
print the next line (city,state,zip)
else
print PO BOX
endif

....suggests that you need something other than "how do I specifiy a blank
line if a 0 is found?", e.g.

{ IF { MERGEFIELD "PO Box" } = 0
"{ MERGEFIELD City }, { MERGEFIELD State } { MERGEFIELD Zip }"
"{ MERGEFIELD "PO Box" }" }

--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

Janiskdot said:
I still don't understand how this is to be done. I can not see a
difference between what you listed as something I might use and what you
think I should use. What does 'abc' stand for in your example?
 
J

Janiskdot

I am so sorry to bother you again...

I tried the code you suggested but when I previewed the letters it just shows the code but doesn't execute it. I do not know if I am suppose to put the code where I would normally 'insert' my fields, using the Mail Merge Wizard, or if there is some icon that I should use.

Thank you for your patience and your help.
 
P

Peter Jamieson

Use ctrl-F9 to insert the special field code braces {} and type everything
else using the usual keystrokes.

Use Alt-F9 to toggle between "field code" view and "field results view"

--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

Janiskdot said:
I am so sorry to bother you again....

I tried the code you suggested but when I previewed the letters it just
shows the code but doesn't execute it. I do not know if I am suppose to put
the code where I would normally 'insert' my fields, using the Mail Merge
Wizard, or if there is some icon that I should use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top