Group:  Microsoft Word » microsoft.public.word.mailmerge.fields
Thread: Ignore blank address fields

Geek News

Ignore blank address fields
GregNga 12/16/2008 3:47:01 AM
How to I get Word mail merge to ignore blank address fields. In other words,
If address field 2 is blank, I don't want to priht a blank line
Re: Ignore blank address fields
"macropod" <macropod[ at ]invalid.invalid> 12/16/2008 4:52:48 AM
Hi Greg,

When executing the merge, Word gives you the option to print or not print blank lines.

Alternatively, you could suppress the blank lines via the use of an IF field. To do this:
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get:
«MyData»«MyData»;
.. select both fields and Press Ctrl-F9, you'll get:
{ «MyData»«MyData» };
.. fill in between the braces so that you end up with:
{IF«myData»= "" "" "«MyData»¶
"},
where the '¶' is a paragraph mark or line-feed, depending on which you're using
.. delete the existing paragraph mark or line-feed that's outside the mergefield;
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[MVP - Microsoft Word]


"GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
[Quoted Text]
> How to I get Word mail merge to ignore blank address fields. In other words,
> If address field 2 is blank, I don't want to priht a blank line

Re: Ignore blank address fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 12/16/2008 4:54:07 AM
You will need to use an If...then...Else field construction

{ IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
field2 }¶
{ MERGEFIELD field3 }" }

You must use Ctrl+F9 to insert each pair of field delimiters and where the ¶
appears in the above, you need to press the Enter key or Shift + Enter.

Use Alt+F9 to toggle off the display of the field codes.

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

"GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
[Quoted Text]
> How to I get Word mail merge to ignore blank address fields. In other
> words,
> If address field 2 is blank, I don't want to priht a blank line


Re: Ignore blank address fields
GregNga 12/16/2008 5:16:30 PM
When I went thru the process described in the help text and when I got to
the MERGE dialogue box, I selected "don't print blank lines when data fields
are empty". After I clciked the MERGE button, I noticed the document that was
populated still had blank lines for the blank address fields. Does this go
away when you print them.

"macropod" wrote:

[Quoted Text]
> Hi Greg,
>
> When executing the merge, Word gives you the option to print or not print blank lines.
>
> Alternatively, you could suppress the blank lines via the use of an IF field. To do this:
> .. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get:
> «MyData»«MyData»;
> .. select both fields and Press Ctrl-F9, you'll get:
> { «MyData»«MyData» };
> .. fill in between the braces so that you end up with:
> {IF«myData»= "" "" "«MyData»¶
> "},
> where the '¶' is a paragraph mark or line-feed, depending on which you're using
> .. delete the existing paragraph mark or line-feed that's outside the mergefield;
> .. position the cursor anywhere in this field and press F9 to update it;
> .. run your mailmerge.
>
>
> --
> Cheers
> macropod
> [MVP - Microsoft Word]
>
>
> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
> > How to I get Word mail merge to ignore blank address fields. In other words,
> > If address field 2 is blank, I don't want to priht a blank line
>
>
Re: Ignore blank address fields
GregNga 12/17/2008 2:43:00 AM
Here is how I want to format the envelope:


Title Firstname Lastname
Addr1
Addr2
City State Zip

I only want to print the line with Addr2 if it is non-blank. How do I format
my document using If, Then Else


"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> You will need to use an If...then...Else field construction
>
> { IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
> field2 }¶
> { MERGEFIELD field3 }" }
>
> You must use Ctrl+F9 to insert each pair of field delimiters and where the ¶
> appears in the above, you need to press the Enter key or Shift + Enter.
>
> Use Alt+F9 to toggle off the display of the field codes.
>
> --
> 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
>
> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
> news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
> > How to I get Word mail merge to ignore blank address fields. In other
> > words,
> > If address field 2 is blank, I don't want to priht a blank line
>
>
>
Re: Ignore blank address fields
"macropod" <macropod[ at ]invalid.invalid> 12/17/2008 6:16:41 AM
Hi greg,

To do what you're after, follow the steps for the alternate method I gave you in my previous post.

--
Cheers
macropod
[MVP - Microsoft Word]


"GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message news:4E7384A6-37E8-4C14-A30C-D13D19B3885D[ at ]microsoft.com...
[Quoted Text]
> Here is how I want to format the envelope:
>
>
> Title Firstname Lastname
> Addr1
> Addr2
> City State Zip
>
> I only want to print the line with Addr2 if it is non-blank. How do I format
> my document using If, Then Else
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> You will need to use an If...then...Else field construction
>>
>> { IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
>> field2 }¶
>> { MERGEFIELD field3 }" }
>>
>> You must use Ctrl+F9 to insert each pair of field delimiters and where the ¶
>> appears in the above, you need to press the Enter key or Shift + Enter.
>>
>> Use Alt+F9 to toggle off the display of the field codes.
>>
>> --
>> 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
>>
>> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
>> news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
>> > How to I get Word mail merge to ignore blank address fields. In other
>> > words,
>> > If address field 2 is blank, I don't want to priht a blank line
>>
>>
>>

Re: Ignore blank address fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 12/17/2008 6:24:34 AM
{ MAILMERGE Title} { MAILMERGE Firstname } { MAILMERGE Lastname }[Enter]
{ MAILMERGE Addr1 }[Enter]
{ IF { MAILMERGE Addr2 } = "" "{ MAILMERGE City } { MAILMERGE State } {
MAILMERGE Zip }" "{ MAILMERGE Addr2 }[Enter]
{MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }

Use the Enter Key or Shift+Enter in place of the [Enter] above.
--
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

"GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
news:4E7384A6-37E8-4C14-A30C-D13D19B3885D[ at ]microsoft.com...
[Quoted Text]
> Here is how I want to format the envelope:
>
>
> Title Firstname Lastname
> Addr1
> Addr2
> City State Zip
>
> I only want to print the line with Addr2 if it is non-blank. How do I
> format
> my document using If, Then Else
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> You will need to use an If...then...Else field construction
>>
>> { IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
>> field2 }¶
>> { MERGEFIELD field3 }" }
>>
>> You must use Ctrl+F9 to insert each pair of field delimiters and where
>> the ¶
>> appears in the above, you need to press the Enter key or Shift + Enter.
>>
>> Use Alt+F9 to toggle off the display of the field codes.
>>
>> --
>> 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
>>
>> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
>> news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
>> > How to I get Word mail merge to ignore blank address fields. In other
>> > words,
>> > If address field 2 is blank, I don't want to priht a blank line
>>
>>
>>


Re: Ignore blank address fields
GregNga 12/17/2008 3:07:01 PM
I see this a lot more clearly now. Btw, seems that the last line should be
{MAILMERGE City } { MAILMERGE State } { MAILMERGE Zip }" }
instead of
{MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }

Thanks for helping me understand this

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> { MAILMERGE Title} { MAILMERGE Firstname } { MAILMERGE Lastname }[Enter]
> { MAILMERGE Addr1 }[Enter]
> { IF { MAILMERGE Addr2 } = "" "{ MAILMERGE City } { MAILMERGE State } {
> MAILMERGE Zip }" "{ MAILMERGE Addr2 }[Enter]
> {MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }
>
> Use the Enter Key or Shift+Enter in place of the [Enter] above.
> --
> 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
>
> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
> news:4E7384A6-37E8-4C14-A30C-D13D19B3885D[ at ]microsoft.com...
> > Here is how I want to format the envelope:
> >
> >
> > Title Firstname Lastname
> > Addr1
> > Addr2
> > City State Zip
> >
> > I only want to print the line with Addr2 if it is non-blank. How do I
> > format
> > my document using If, Then Else
> >
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> You will need to use an If...then...Else field construction
> >>
> >> { IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
> >> field2 }¶
> >> { MERGEFIELD field3 }" }
> >>
> >> You must use Ctrl+F9 to insert each pair of field delimiters and where
> >> the ¶
> >> appears in the above, you need to press the Enter key or Shift + Enter.
> >>
> >> Use Alt+F9 to toggle off the display of the field codes.
> >>
> >> --
> >> 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
> >>
> >> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
> >> news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
> >> > How to I get Word mail merge to ignore blank address fields. In other
> >> > words,
> >> > If address field 2 is blank, I don't want to priht a blank line
> >>
> >>
> >>
>
>
>
Re: Ignore blank address fields
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 12/17/2008 7:39:12 PM
You are right about the last line. I was of course entering the replicas of
field delimiters from the keyboard (the only way in the mail program) but if
you use Ctrl+F9 to enter then as is necessary to get them to work, you will
always get matched pairs { }.

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

"GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
news:C256D889-BDCE-4B4B-AA06-5581C8382337[ at ]microsoft.com...
[Quoted Text]
>I see this a lot more clearly now. Btw, seems that the last line should be
> {MAILMERGE City } { MAILMERGE State } { MAILMERGE Zip }" }
> instead of
> {MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }
>
> Thanks for helping me understand this
>
> "Doug Robbins - Word MVP" wrote:
>
>> { MAILMERGE Title} { MAILMERGE Firstname } { MAILMERGE Lastname }[Enter]
>> { MAILMERGE Addr1 }[Enter]
>> { IF { MAILMERGE Addr2 } = "" "{ MAILMERGE City } { MAILMERGE State } {
>> MAILMERGE Zip }" "{ MAILMERGE Addr2 }[Enter]
>> {MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }
>>
>> Use the Enter Key or Shift+Enter in place of the [Enter] above.
>> --
>> 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
>>
>> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
>> news:4E7384A6-37E8-4C14-A30C-D13D19B3885D[ at ]microsoft.com...
>> > Here is how I want to format the envelope:
>> >
>> >
>> > Title Firstname Lastname
>> > Addr1
>> > Addr2
>> > City State Zip
>> >
>> > I only want to print the line with Addr2 if it is non-blank. How do I
>> > format
>> > my document using If, Then Else
>> >
>> >
>> > "Doug Robbins - Word MVP" wrote:
>> >
>> >> You will need to use an If...then...Else field construction
>> >>
>> >> { IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
>> >> field2 }¶
>> >> { MERGEFIELD field3 }" }
>> >>
>> >> You must use Ctrl+F9 to insert each pair of field delimiters and where
>> >> the ¶
>> >> appears in the above, you need to press the Enter key or Shift +
>> >> Enter.
>> >>
>> >> Use Alt+F9 to toggle off the display of the field codes.
>> >>
>> >> --
>> >> 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
>> >>
>> >> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
>> >> news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
>> >> > How to I get Word mail merge to ignore blank address fields. In
>> >> > other
>> >> > words,
>> >> > If address field 2 is blank, I don't want to priht a blank line
>> >>
>> >>
>> >>
>>
>>
>>


Re: Ignore blank address fields
GregNga 12/17/2008 8:52:13 PM
Yes, it's been very helpful.........thanks

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> You are right about the last line. I was of course entering the replicas of
> field delimiters from the keyboard (the only way in the mail program) but if
> you use Ctrl+F9 to enter then as is necessary to get them to work, you will
> always get matched pairs { }.
>
> --
> 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
>
> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
> news:C256D889-BDCE-4B4B-AA06-5581C8382337[ at ]microsoft.com...
> >I see this a lot more clearly now. Btw, seems that the last line should be
> > {MAILMERGE City } { MAILMERGE State } { MAILMERGE Zip }" }
> > instead of
> > {MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }
> >
> > Thanks for helping me understand this
> >
> > "Doug Robbins - Word MVP" wrote:
> >
> >> { MAILMERGE Title} { MAILMERGE Firstname } { MAILMERGE Lastname }[Enter]
> >> { MAILMERGE Addr1 }[Enter]
> >> { IF { MAILMERGE Addr2 } = "" "{ MAILMERGE City } { MAILMERGE State } {
> >> MAILMERGE Zip }" "{ MAILMERGE Addr2 }[Enter]
> >> {MAILMERGE City { { MAILMERGE State } { MAILMERGE Zip }" }
> >>
> >> Use the Enter Key or Shift+Enter in place of the [Enter] above.
> >> --
> >> 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
> >>
> >> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
> >> news:4E7384A6-37E8-4C14-A30C-D13D19B3885D[ at ]microsoft.com...
> >> > Here is how I want to format the envelope:
> >> >
> >> >
> >> > Title Firstname Lastname
> >> > Addr1
> >> > Addr2
> >> > City State Zip
> >> >
> >> > I only want to print the line with Addr2 if it is non-blank. How do I
> >> > format
> >> > my document using If, Then Else
> >> >
> >> >
> >> > "Doug Robbins - Word MVP" wrote:
> >> >
> >> >> You will need to use an If...then...Else field construction
> >> >>
> >> >> { IF { MERGEFIELD field2 } = "" "{ MERGEFIELD field3 }" "{ MERGEFIELD
> >> >> field2 }¶
> >> >> { MERGEFIELD field3 }" }
> >> >>
> >> >> You must use Ctrl+F9 to insert each pair of field delimiters and where
> >> >> the ¶
> >> >> appears in the above, you need to press the Enter key or Shift +
> >> >> Enter.
> >> >>
> >> >> Use Alt+F9 to toggle off the display of the field codes.
> >> >>
> >> >> --
> >> >> 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
> >> >>
> >> >> "GregNga" <GregNga[ at ]discussions.microsoft.com> wrote in message
> >> >> news:8C26894C-A9E5-497F-82A4-4D5D869D157E[ at ]microsoft.com...
> >> >> > How to I get Word mail merge to ignore blank address fields. In
> >> >> > other
> >> >> > words,
> >> >> > If address field 2 is blank, I don't want to priht a blank line
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net