If statement almost works

K

kojaks43

I recently learned how to avoid (blank) to be printed when the data cell is
blank in a merge.
I placed the If statement on the same line as the Address1 saying, if
Address2 was not blank to place Address2 data.

It works fine, except it places Address2 on the same line as Address1.

When I moved the If statement below Address1, it placed the data for
Address2 correctly. HOWEVER, when Address2 was a blank cell, it just left an
extra line between Address1 and City, State Zip.

Is there a way to eliminate the empty line?
k
 
P

Peter Jamieson

You have to folow Graham's code exactly:

Mergefield Address1}{IF {Mergefield Address2} <> "" "
{Mergefield Address2}"}

There should be a paragraph mark after <> "" "

If there isn't one, put the insertion point immediately after that third
double quote and press enter to insert a new paragraph mark in the usual
way.

Peter Jamieson
 
K

kojaks43

I'm sorry I do not have any experience with this. When you say place
Paragraph mark, I am at a loss. Just selecting Alt F9, putting the insertion
point at the 3rd double and pressing <enter> does not place a Paragraph Mark.
k
 
P

Peter Jamieson

point at the 3rd double and pressing said:

It should, unless you have overtype mode on, in which case try pressing the
Insert key first.

You might find it using to click the button in the toolbar with the reverse
P (i.e. like a paragraph mark) so you can see all the marks, tabs and so on.


Peter Jamieson
 
K

kojaks43

point at the 3rd double and pressing said:

It should, unless you have overtype mode on, in which case try pressing the
Insert key first.

You might find it using to click the button in the toolbar with the reverse
P (i.e. like a paragraph mark) so you can see all the marks, tabs and so on.

I tried using the Paragraph mark on the tool bar. Unfortunately, I selected
the wrong one (there are 3, the correct one, and the Left to Right and Right
to Left ones.
When I selected the correct one, and did the insert it worked!!

Thanks
k
 
G

Graham Mayor

Peter has covered the essential points but to clarify the use of the
conditional field

{IF {Mergefield fieldname} <> "" "Do this" "Otherwise do this"}
or if you don't need the second part
{IF {Mergefield fieldname} <> "" "Do this"}
which is essentially what I posted earlier.
You can put just about anything you want between the quotes where I have
written "Do this", including pressing the enter key to move down a line (the
paragraph mark) or a whole lot more if need be.
The construction I used inserted a new paragraph (by pressing the enter key)
then put the field on the following line, only if the condition was met.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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

Similar Threads


Top