Add a line feed if the value of a field is 1

D

dixie

I am using MS Access 2000 to open MS Word 2000 by automation. What I am
looking for right now is a way to add a line feed to the merge document if
the value of one of the fields sent by Access is 1. I can see where, if I
had some kind of code for a line feed that wouldn't print as text, I might
be able to use the Insert Word Field, If then else.

What I am looking to do is make Word put in a blank line if the length of
the field is going to be less than one line. I think I could have a field
in Access that could alert the mailmerge document that a new line was
needed. All I need is a way to make the mailmerge document do a carriage
return at the end of the previous line.
Any ideas on how I can do this?

dixie
 
P

Peter Jamieson

You shouldn't need a special code. What you do is simply insert an actual
line feed within your IF field. E.g.

{ IF { MERGEFIELD needlinefeed } = 1 "
" "" }
 
D

dixie

When I do this Peter, what comes out after the merge is 3 " marks on one
line, followed by 3 on the next line. Like the following.
" ""
" ""
It is obviously doing the line feed as there is a 2nd line, but the Quote
marks are also coming out. I probably should add that this is inside a
table cell in a table.

dixie
 
D

dixie

Actually, I have just worked out (I think) that you have to do a shift
enter, although I am unsure of the reason.

dixie
 
P

Peter Jamieson

FWIW I don't get this here, whether I use enter (a paragraph mark) or
shift-enter (a line break). Although you seem to have worked around the
problem anyway, if you want, despam my e-mail address, send me a copy of
your .doc and I'll have a look at it here.
 

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