A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to I print only non-blank fields in Mail Merge?



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2009, 08:06 AM posted to microsoft.public.word.mailmerge.fields
Kathleen
external usenet poster
 
Posts: 115
Default How to I print only non-blank fields in Mail Merge?

I am using Word 2003. I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields are
empty. How can I do that?
  #2  
Old June 30th, 2009, 08:34 AM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default How to I print only non-blank fields in Mail Merge?

Use the SkipIf field to test if an appropriate mergefield is blank. If it
is, that record will be skipped.

--
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, originally posted via msnews.microsoft.com
"Kathleen" wrote in message
...
I am using Word 2003. I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields
are
empty. How can I do that?


  #3  
Old June 30th, 2009, 11:47 AM posted to microsoft.public.word.mailmerge.fields
Lester Lane
external usenet poster
 
Posts: 42
Default How to I print only non-blank fields in Mail Merge?

On 30 June, 08:34, "Doug Robbins - Word MVP"
wrote:
Use the SkipIf field to test if an appropriate mergefield is blank. *If it
is, that record will be skipped.

--
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, originally posted via msnews.microsoft.com"Kathleen" wrote in message

...

I am using Word 2003. *I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields
are
empty. How can I do that?


I too have this issue. I don't think the above has answered this. I
don't want to go to the next record, I want the data field to be
skipped or not printed. Eg a London address does not have a County so
the postcode should be "pulled up" to appear under London. I don't
want the next address! Am I right Kathleen?
  #4  
Old June 30th, 2009, 12:28 PM posted to microsoft.public.word.mailmerge.fields
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default How to I print only non-blank fields in Mail Merge?

Hi Kathleen,

If you're wanting to skip the whole record when the specified field is empty, the approach suggested by Doug will work.

However, if you're just trying to hide the space taken up by an empty field when it's positioned between two others, you can use an
IF test coded along the lines of:

Empty Space Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field, thus {«MyData»«MyData»};
.. fill in around the new field braces so that you end up with: {IF«MyData»= "" "" "«MyData» "};
.. delete the space after the field.


Empty Line Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field, thus { «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 after the field.

When you're done with the above:
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[Microsoft MVP - Word]


"Kathleen" wrote in message ...
I am using Word 2003. I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields are
empty. How can I do that?


  #5  
Old June 30th, 2009, 04:38 PM posted to microsoft.public.word.mailmerge.fields
Lester Lane
external usenet poster
 
Posts: 42
Default How to I print only non-blank fields in Mail Merge?

On 30 June, 12:28, "macropod" wrote:
Hi Kathleen,

If you're wanting to skip the whole record when the specified field is empty, the approach suggested by Doug will work.

However, if you're just trying to hide the space taken up by an empty field when it's positioned between two others, you can use an
IF test coded along the lines of:

Empty Space Suppression-
. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get «MyData»«MyData»;
. select both fields and Press Ctrl-F9 to enclose them in a new field, thus {«MyData»«MyData»};
. fill in around the new field braces so that you end up with: {IF«MyData»= "" "" "«MyData» "};
. delete the space after the field.

Empty Line Suppression-
. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get «MyData»«MyData»;
. select both fields and Press Ctrl-F9 to enclose them in a new field, thus { «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 after the field.

When you're done with the above:
. position the cursor anywhere in this field and press F9 to update it;
. run your mailmerge.

--
Cheers
macropod
[Microsoft MVP - Word]

"Kathleen" wrote in ...
I am using Word 2003. *I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields are
empty. How can I do that?


Kathleen,
I re-read your question in less haste and realise I got the wrong end
of the stick! It is quite clear actually. I have fixed my issue with
an IF statement. Thanks all.
  #6  
Old July 7th, 2009, 07:43 PM posted to microsoft.public.word.mailmerge.fields
sandra
external usenet poster
 
Posts: 203
Default How to I print only non-blank fields in Mail Merge?

Hi! I'm using Office 2007 and I *think* this thread is what I'm trying to do
but I'm not quite sure.

I have an Excel spreadsheet with Name, Organization, Address, City,
Province, Postal Code and I'm trying to make labels from it. However, some
rows do not have anything in the Organization field so when I go to make a
label, I've been having to manually edit the labels to remove that blank
space.

In Office 2000, I seem to recall that there was just a check box where the
blank field would be ignored and it all worked out fine but I'm under the
impression that Office 2007 isn't so simple that way. If the procedure below
is what I need, can someone point me to a more detailed, simple instructions
since I'm not understanding what I'm copying and where I'm CTRL-F9ing....? :-)

Thanks in advance!

sandra


"macropod" wrote:

Hi Kathleen,

If you're wanting to skip the whole record when the specified field is empty, the approach suggested by Doug will work.

However, if you're just trying to hide the space taken up by an empty field when it's positioned between two others, you can use an
IF test coded along the lines of:

Empty Space Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field, thus {«MyData»«MyData»};
.. fill in around the new field braces so that you end up with: {IF«MyData»= "" "" "«MyData» "};
.. delete the space after the field.


Empty Line Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field, thus { «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 after the field.

When you're done with the above:
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[Microsoft MVP - Word]


"Kathleen" wrote in message ...
I am using Word 2003. I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields are
empty. How can I do that?



  #7  
Old July 7th, 2009, 11:02 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default How to I print only non-blank fields in Mail Merge?

I assume that you have the mergefields inserted something like:

Name
Organization
Address
City Province Postal Code

Insert additional mergefields so that you have

Name
OrganizationOrganizationAddressAddre ss
City Province Postal Code

If you press Alt+F9 to toggle on the field codes and click on the Show/Hide
(¶) button to show formatting marks, you will see

{ MERGEFIELD "Name" }¶
{ MERGEFIELD "Organization" }{ MERGEFIELD "Organization" }{ MERGEFIELD
"Address }{ MERGEFIELD "Address }¶
{ MERGEFIELD "City" } { MERGEFIELD "Province" } { MERGEFIELD "Postal Code" )

Select the second line and press Ctrl+F9 and then you will see:

{ MERGEFIELD "Name" }¶
{ { MERGEFIELD "Organization" }{ MERGEFIELD "Organization" }{ MERGEFIELD
"Address }{ MERGEFIELD "Address } }¶
{ MERGEFIELD "City" } { MERGEFIELD "Province" } { MERGEFIELD "Postal Code" )

Now, modify that so that it looks as follows, pressing the Enter key where
the ¶ appears after { MERGEFIELD "Organization" }

{ MERGEFIELD "Name" }¶
{ IF { MERGEFIELD "Organization" } "" "{ MERGEFIELD "Organization" }¶
{ MERGEFIELD "Address }" "{ MERGEFIELD "Address }" }¶
{ MERGEFIELD "City" } { MERGEFIELD "Province" } { MERGEFIELD "Postal Code" )



--
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, originally posted via msnews.microsoft.com
"sandra" wrote in message
...
Hi! I'm using Office 2007 and I *think* this thread is what I'm trying to
do
but I'm not quite sure.

I have an Excel spreadsheet with Name, Organization, Address, City,
Province, Postal Code and I'm trying to make labels from it. However, some
rows do not have anything in the Organization field so when I go to make a
label, I've been having to manually edit the labels to remove that blank
space.

In Office 2000, I seem to recall that there was just a check box where the
blank field would be ignored and it all worked out fine but I'm under the
impression that Office 2007 isn't so simple that way. If the procedure
below
is what I need, can someone point me to a more detailed, simple
instructions
since I'm not understanding what I'm copying and where I'm CTRL-F9ing....?
:-)

Thanks in advance!

sandra


"macropod" wrote:

Hi Kathleen,

If you're wanting to skip the whole record when the specified field is
empty, the approach suggested by Doug will work.

However, if you're just trying to hide the space taken up by an empty
field when it's positioned between two others, you can use an
IF test coded along the lines of:

Empty Space Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that
you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field,
thus {«MyData»«MyData»};
.. fill in around the new field braces so that you end up with:
{IF«MyData»= "" "" "«MyData» "};
.. delete the space after the field.


Empty Line Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that
you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field,
thus { «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 after the field.

When you're done with the above:
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[Microsoft MVP - Word]


"Kathleen" wrote in message
...
I am using Word 2003. I have my merged document and data fields. Some
data
fields are empty and I do not wish to print those records when the
fields are
empty. How can I do that?




  #8  
Old July 8th, 2009, 12:35 AM posted to microsoft.public.word.mailmerge.fields
sandra
external usenet poster
 
Posts: 203
Default How to I print only non-blank fields in Mail Merge?

blink

Wow! That's amazingly convoluted to my mind. Thank you so much for the step
by step instructions as I would never in a million years have puzzled that
out.

I wonder why the process became so complicated when Office 2000 was so very
simple....

sandra


"Doug Robbins - Word MVP" wrote:

I assume that you have the mergefields inserted something like:

Name
Organization
Address
City Province Postal Code

Insert additional mergefields so that you have

Name
OrganizationOrganizationAddressAddre ss
City Province Postal Code

If you press Alt+F9 to toggle on the field codes and click on the Show/Hide
(¶) button to show formatting marks, you will see

{ MERGEFIELD "Name" }¶
{ MERGEFIELD "Organization" }{ MERGEFIELD "Organization" }{ MERGEFIELD
"Address }{ MERGEFIELD "Address }¶
{ MERGEFIELD "City" } { MERGEFIELD "Province" } { MERGEFIELD "Postal Code" )

Select the second line and press Ctrl+F9 and then you will see:

{ MERGEFIELD "Name" }¶
{ { MERGEFIELD "Organization" }{ MERGEFIELD "Organization" }{ MERGEFIELD
"Address }{ MERGEFIELD "Address } }¶
{ MERGEFIELD "City" } { MERGEFIELD "Province" } { MERGEFIELD "Postal Code" )

Now, modify that so that it looks as follows, pressing the Enter key where
the ¶ appears after { MERGEFIELD "Organization" }

{ MERGEFIELD "Name" }¶
{ IF { MERGEFIELD "Organization" } "" "{ MERGEFIELD "Organization" }¶
{ MERGEFIELD "Address }" "{ MERGEFIELD "Address }" }¶
{ MERGEFIELD "City" } { MERGEFIELD "Province" } { MERGEFIELD "Postal Code" )



--
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, originally posted via msnews.microsoft.com
"sandra" wrote in message
...
Hi! I'm using Office 2007 and I *think* this thread is what I'm trying to
do
but I'm not quite sure.

I have an Excel spreadsheet with Name, Organization, Address, City,
Province, Postal Code and I'm trying to make labels from it. However, some
rows do not have anything in the Organization field so when I go to make a
label, I've been having to manually edit the labels to remove that blank
space.

In Office 2000, I seem to recall that there was just a check box where the
blank field would be ignored and it all worked out fine but I'm under the
impression that Office 2007 isn't so simple that way. If the procedure
below
is what I need, can someone point me to a more detailed, simple
instructions
since I'm not understanding what I'm copying and where I'm CTRL-F9ing....?
:-)

Thanks in advance!

sandra


"macropod" wrote:

Hi Kathleen,

If you're wanting to skip the whole record when the specified field is
empty, the approach suggested by Doug will work.

However, if you're just trying to hide the space taken up by an empty
field when it's positioned between two others, you can use an
IF test coded along the lines of:

Empty Space Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that
you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field,
thus {«MyData»«MyData»};
.. fill in around the new field braces so that you end up with:
{IF«MyData»= "" "" "«MyData» "};
.. delete the space after the field.


Empty Line Suppression-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that
you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field,
thus { «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 after the field.

When you're done with the above:
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[Microsoft MVP - Word]


"Kathleen" wrote in message
...
I am using Word 2003. I have my merged document and data fields. Some
data
fields are empty and I do not wish to print those records when the
fields are
empty. How can I do that?




  #9  
Old July 10th, 2009, 11:38 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default How to I print only non-blank fields in Mail Merge?

In that case you need to use an If...then...Else field construction as
follows

{ MERGEFIELD City }¶
{ IF { MERGEFIELD County } "" "{ MERGEFIELD County }¶
{ MERGEFIELD PostCode }" "{ MERGEFIELD PostCode }" }¶

In the above, you must use Ctrl+F9 to insert each pair of field delimiters
{ } and you need to press the Enter key where the ¶ symbol is shown.

You can start by inserting the mergefields as follows

City ¶
County "" " County¶
PostCode" "PostCode" ¶

then use Alt+F9 to toggle on the display of the field codes and you will see

{ MERGEFIELD City }¶
{ MERGEFIELD County } "" "{ MERGEFIELD County }¶
{ MERGEFIELD PostCode }" "{ MERGEFIELD PostCode }" ¶

Then select the second and third lines, excluding the final paragraph mark
and press Ctrl+F9 which will then enclose those fields inside another pair
of field delimiters and then you just need to enter the IF in the position
shown.

Not the there are spaces either side of the and between the "" " in the
second line and between the " " in the third line.
--
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, originally posted via msnews.microsoft.com
"Lester Lane" wrote in message
...
On 30 June, 08:34, "Doug Robbins - Word MVP"
wrote:
Use the SkipIf field to test if an appropriate mergefield is blank. If it
is, that record will be skipped.

--
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, originally posted via
msnews.microsoft.com"Kathleen" wrote
in message

...

I am using Word 2003. I have my merged document and data fields. Some
data
fields are empty and I do not wish to print those records when the
fields
are
empty. How can I do that?


I too have this issue. I don't think the above has answered this. I
don't want to go to the next record, I want the data field to be
skipped or not printed. Eg a London address does not have a County so
the postcode should be "pulled up" to appear under London. I don't
want the next address! Am I right Kathleen?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.