Merge in Word w Excel Database

S

SassyCat

Does anyone know how to get your merge form in Word to delete an unnecessary
line between paragraphs when it merges with an Excel database and only uses
one of two possible options in the merge process? The document I have has
two possible options in a paragraph. If it the first option is filled in and
not the second it leaves a blank line between the paragraphs. The second
option is followed by a set of bulleted paragraph options that go with the
second option, therefore the extral line comes in when none of the bulleted
options are chosen.

Help please, thank you.
 
M

macropod

Hi SassyCat,

If you copy and paste your existing mailmerge field, which probably looks
something like:
«ExcelData»
so that you've got:
«ExcelData»«ExcelData»
then select both fields and Press Ctrl-F9, you'll get:
{ «ExcelData»«ExcelData» }
If you then fill in between the braces so that you've got:
{IF«ExcelData»= "" "" "«ExcelData»¶
"}
where the '¶' is a paragraph mark or line-feed, depending on which you're using, and delete the existing paragraph mark or line-feed
that's outside the mergefield, that should give the result you're after.
 
D

Doug Robbins - Word MVP

Use an { IF } field construction. More information would be required to be
able to give you the complete construction that you would need.

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

SassyCat

This partially helps. Here is what my merge fields look like.

«Option_A1» «Option_A2»

• «Option_B»
• «Option_C»
• «Option_D»
• «Option_E»
• «Option_F»

«Paragraph_G_or_H»

Can you be more specific. I tried it and I get a couple different results.
But not what I exactly need. If Option A1 is chosen and A2 trough F are not,
I get an extra line between the A1 paragraph and Paragraph G or H. I presume
this is happening because of the extra lines between "Options A2 and B" and
"Option F and Paragraph G or H".




macropod said:
Hi SassyCat,

If you copy and paste your existing mailmerge field, which probably looks
something like:
«ExcelData»
so that you've got:
«ExcelData»«ExcelData»
then select both fields and Press Ctrl-F9, you'll get:
{ «ExcelData»«ExcelData» }
If you then fill in between the braces so that you've got:
{IF«ExcelData»= "" "" "«ExcelData»¶
"}
where the '¶' is a paragraph mark or line-feed, depending on which you're using, and delete the existing paragraph mark or line-feed
that's outside the mergefield, that should give the result you're after.

--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
Does anyone know how to get your merge form in Word to delete an unnecessary
line between paragraphs when it merges with an Excel database and only uses
one of two possible options in the merge process? The document I have has
two possible options in a paragraph. If it the first option is filled in and
not the second it leaves a blank line between the paragraphs. The second
option is followed by a set of bulleted paragraph options that go with the
second option, therefore the extral line comes in when none of the bulleted
options are chosen.

Help please, thank you.
 
M

macropod

Hi SassyCat,

Are you saying that, if Option_A1 has a value in it, then Options A2 through to Option F should be hidden and, conversely, Options
A2 through to Option F should all be displayed if Option_A1 is empty? If so, try coding the fields like:

{IF«Option_A1»= "" "«Option_A2»¶
¶
• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

Be careful to get the spacing and the double quotes right.

Alternatively if you need to toggle the paragraphs for options B-F, according to whether they have content, each of them should be
coded along the lines of:
{IF«Option_B»<> "" "«Option_B»¶
"}
or:
{IF«Option_B»= "" "" "«Option_B»¶
"}
Note that, if needed, you can add the same construction for options B-F to the first example, above. There will then only remain the
issue of what to do with the extra paragraph mark between «Option_A2» and «Paragraph_G_or_H» if «Option_A2» is used but all of
Options B-F are empty. If that's a possibility, you could insert a field coded as:
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}
Thus:
{IF«Option_A1»= "" "«Option_A2»¶
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
This partially helps. Here is what my merge fields look like.

«Option_A1» «Option_A2»

• «Option_B»
• «Option_C»
• «Option_D»
• «Option_E»
• «Option_F»

«Paragraph_G_or_H»

Can you be more specific. I tried it and I get a couple different results.
But not what I exactly need. If Option A1 is chosen and A2 trough F are not,
I get an extra line between the A1 paragraph and Paragraph G or H. I presume
this is happening because of the extra lines between "Options A2 and B" and
"Option F and Paragraph G or H".




macropod said:
Hi SassyCat,

If you copy and paste your existing mailmerge field, which probably looks
something like:
«ExcelData»
so that you've got:
«ExcelData»«ExcelData»
then select both fields and Press Ctrl-F9, you'll get:
{ «ExcelData»«ExcelData» }
If you then fill in between the braces so that you've got:
{IF«ExcelData»= "" "" "«ExcelData»¶
"}
where the '¶' is a paragraph mark or line-feed, depending on which you're using, and delete the existing paragraph mark or
line-feed
that's outside the mergefield, that should give the result you're after.

--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
Does anyone know how to get your merge form in Word to delete an unnecessary
line between paragraphs when it merges with an Excel database and only uses
one of two possible options in the merge process? The document I have has
two possible options in a paragraph. If it the first option is filled in and
not the second it leaves a blank line between the paragraphs. The second
option is followed by a set of bulleted paragraph options that go with the
second option, therefore the extral line comes in when none of the bulleted
options are chosen.

Help please, thank you.
 
S

SassyCat

Thanks, this gives me enough information to set it up. I appreciate the help.

macropod said:
Hi SassyCat,

Are you saying that, if Option_A1 has a value in it, then Options A2 through to Option F should be hidden and, conversely, Options
A2 through to Option F should all be displayed if Option_A1 is empty? If so, try coding the fields like:

{IF«Option_A1»= "" "«Option_A2»¶
¶
• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

Be careful to get the spacing and the double quotes right.

Alternatively if you need to toggle the paragraphs for options B-F, according to whether they have content, each of them should be
coded along the lines of:
{IF«Option_B»<> "" "«Option_B»¶
"}
or:
{IF«Option_B»= "" "" "«Option_B»¶
"}
Note that, if needed, you can add the same construction for options B-F to the first example, above. There will then only remain the
issue of what to do with the extra paragraph mark between «Option_A2» and «Paragraph_G_or_H» if «Option_A2» is used but all of
Options B-F are empty. If that's a possibility, you could insert a field coded as:
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}
Thus:
{IF«Option_A1»= "" "«Option_A2»¶
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
This partially helps. Here is what my merge fields look like.

«Option_A1» «Option_A2»

• «Option_B»
• «Option_C»
• «Option_D»
• «Option_E»
• «Option_F»

«Paragraph_G_or_H»

Can you be more specific. I tried it and I get a couple different results.
But not what I exactly need. If Option A1 is chosen and A2 trough F are not,
I get an extra line between the A1 paragraph and Paragraph G or H. I presume
this is happening because of the extra lines between "Options A2 and B" and
"Option F and Paragraph G or H".




macropod said:
Hi SassyCat,

If you copy and paste your existing mailmerge field, which probably looks
something like:
«ExcelData»
so that you've got:
«ExcelData»«ExcelData»
then select both fields and Press Ctrl-F9, you'll get:
{ «ExcelData»«ExcelData» }
If you then fill in between the braces so that you've got:
{IF«ExcelData»= "" "" "«ExcelData»¶
"}
where the '¶' is a paragraph mark or line-feed, depending on which you're using, and delete the existing paragraph mark or
line-feed
that's outside the mergefield, that should give the result you're after.

--
Cheers
macropod
[MVP - Microsoft Word]


Does anyone know how to get your merge form in Word to delete an unnecessary
line between paragraphs when it merges with an Excel database and only uses
one of two possible options in the merge process? The document I have has
two possible options in a paragraph. If it the first option is filled in and
not the second it leaves a blank line between the paragraphs. The second
option is followed by a set of bulleted paragraph options that go with the
second option, therefore the extral line comes in when none of the bulleted
options are chosen.

Help please, thank you.
 
S

SassyCat

I though I had enough information, but there is one more scenario that might
happen. They may choose both Option A1 and Option A2 as well as having only
some of the Options B-F chosen. I need to incorporate both options A1 and A2
as a possibility and have it not put any extra lines in if one of the options
B-F is not chosen.

More help please.

macropod said:
Hi SassyCat,

Are you saying that, if Option_A1 has a value in it, then Options A2 through to Option F should be hidden and, conversely, Options
A2 through to Option F should all be displayed if Option_A1 is empty? If so, try coding the fields like:

{IF«Option_A1»= "" "«Option_A2»¶
¶
• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

Be careful to get the spacing and the double quotes right.

Alternatively if you need to toggle the paragraphs for options B-F, according to whether they have content, each of them should be
coded along the lines of:
{IF«Option_B»<> "" "«Option_B»¶
"}
or:
{IF«Option_B»= "" "" "«Option_B»¶
"}
Note that, if needed, you can add the same construction for options B-F to the first example, above. There will then only remain the
issue of what to do with the extra paragraph mark between «Option_A2» and «Paragraph_G_or_H» if «Option_A2» is used but all of
Options B-F are empty. If that's a possibility, you could insert a field coded as:
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}
Thus:
{IF«Option_A1»= "" "«Option_A2»¶
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
This partially helps. Here is what my merge fields look like.

«Option_A1» «Option_A2»

• «Option_B»
• «Option_C»
• «Option_D»
• «Option_E»
• «Option_F»

«Paragraph_G_or_H»

Can you be more specific. I tried it and I get a couple different results.
But not what I exactly need. If Option A1 is chosen and A2 trough F are not,
I get an extra line between the A1 paragraph and Paragraph G or H. I presume
this is happening because of the extra lines between "Options A2 and B" and
"Option F and Paragraph G or H".




macropod said:
Hi SassyCat,

If you copy and paste your existing mailmerge field, which probably looks
something like:
«ExcelData»
so that you've got:
«ExcelData»«ExcelData»
then select both fields and Press Ctrl-F9, you'll get:
{ «ExcelData»«ExcelData» }
If you then fill in between the braces so that you've got:
{IF«ExcelData»= "" "" "«ExcelData»¶
"}
where the '¶' is a paragraph mark or line-feed, depending on which you're using, and delete the existing paragraph mark or
line-feed
that's outside the mergefield, that should give the result you're after.

--
Cheers
macropod
[MVP - Microsoft Word]


Does anyone know how to get your merge form in Word to delete an unnecessary
line between paragraphs when it merges with an Excel database and only uses
one of two possible options in the merge process? The document I have has
two possible options in a paragraph. If it the first option is filled in and
not the second it leaves a blank line between the paragraphs. The second
option is followed by a set of bulleted paragraph options that go with the
second option, therefore the extral line comes in when none of the bulleted
options are chosen.

Help please, thank you.
 
M

macropod

If you need to supress all of Options B-F if A2 is empty, then:

«Option_A1» {IF«Option_A2»<> "" "«Option_A2»¶
¶
{IF«Option_B»<> "" "«Option_B»¶
"}{IF«Option_C»<> "" "«Option_C»¶
"}{IF«Option_D»<> "" "«Option_D»¶
"}{IF«Option_E»<> "" "«Option_E»¶
"}{IF«Option_F»<> "" "«Option_F»¶
"}}¶
¶
«Paragraph_G_or_H»
with the B-F option paragraphs bulleted

Otherwise, if Options B-F are allowable even if Option A2 is empty, the simplest solution is to code each of them along the lines
of:
{IF«Option_B»<> "" "«Option_B»¶
"}


--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
I though I had enough information, but there is one more scenario that might
happen. They may choose both Option A1 and Option A2 as well as having only
some of the Options B-F chosen. I need to incorporate both options A1 and A2
as a possibility and have it not put any extra lines in if one of the options
B-F is not chosen.

More help please.

macropod said:
Hi SassyCat,

Are you saying that, if Option_A1 has a value in it, then Options A2 through to Option F should be hidden and, conversely,
Options
A2 through to Option F should all be displayed if Option_A1 is empty? If so, try coding the fields like:

{IF«Option_A1»= "" "«Option_A2»¶
¶
• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

Be careful to get the spacing and the double quotes right.

Alternatively if you need to toggle the paragraphs for options B-F, according to whether they have content, each of them should
be
coded along the lines of:
{IF«Option_B»<> "" "«Option_B»¶
"}
or:
{IF«Option_B»= "" "" "«Option_B»¶
"}
Note that, if needed, you can add the same construction for options B-F to the first example, above. There will then only remain
the
issue of what to do with the extra paragraph mark between «Option_A2» and «Paragraph_G_or_H» if «Option_A2» is used but all of
Options B-F are empty. If that's a possibility, you could insert a field coded as:
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}
Thus:
{IF«Option_A1»= "" "«Option_A2»¶
{IF(={IF«Option_B»= "" 0 1}+{IF«Option_C»= "" 0 1}+{IF«Option_D»= "" 0 1}+{IF«Option_E»= "" 0 1}+{IF«Option_F»= "" 0 1})> 0 "¶
"}• «Option_B»¶
• «Option_C»¶
• «Option_D»¶
• «Option_E»¶
• «Option_F»¶
" «Option_A1»}¶
¶
«Paragraph_G_or_H»

--
Cheers
macropod
[MVP - Microsoft Word]


SassyCat said:
This partially helps. Here is what my merge fields look like.

«Option_A1» «Option_A2»

• «Option_B»
• «Option_C»
• «Option_D»
• «Option_E»
• «Option_F»

«Paragraph_G_or_H»

Can you be more specific. I tried it and I get a couple different results.
But not what I exactly need. If Option A1 is chosen and A2 trough F are not,
I get an extra line between the A1 paragraph and Paragraph G or H. I presume
this is happening because of the extra lines between "Options A2 and B" and
"Option F and Paragraph G or H".




:

Hi SassyCat,

If you copy and paste your existing mailmerge field, which probably looks
something like:
«ExcelData»
so that you've got:
«ExcelData»«ExcelData»
then select both fields and Press Ctrl-F9, you'll get:
{ «ExcelData»«ExcelData» }
If you then fill in between the braces so that you've got:
{IF«ExcelData»= "" "" "«ExcelData»¶
"}
where the '¶' is a paragraph mark or line-feed, depending on which you're using, and delete the existing paragraph mark or
line-feed
that's outside the mergefield, that should give the result you're after.

--
Cheers
macropod
[MVP - Microsoft Word]


Does anyone know how to get your merge form in Word to delete an unnecessary
line between paragraphs when it merges with an Excel database and only uses
one of two possible options in the merge process? The document I have has
two possible options in a paragraph. If it the first option is filled in and
not the second it leaves a blank line between the paragraphs. The second
option is followed by a set of bulleted paragraph options that go with the
second option, therefore the extral line comes in when none of the bulleted
options are chosen.

Help please, thank you.
 

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