Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andrew St-Johnston Andrew St-Johnston is offline
external usenet poster
 
Posts: 3
Default How to ignore a feild in Mail Merge

I have created an address label for Mail Merge. Becasue I wish the City and
Post Code to be bold I have created an address block by inserting all the
relevant fields. It works perfectly. However becasue a small % of the
mailings are going outside the country the last field is "Country". I do not
want it to print out if the country is "United Kingdom". I can see how to do
this if I use AddressBlock but I do not know how to get at the fields within
AddressBlock to change their properties. Just to complicate things my default
country for Word is USA. I know I can work around the problem by doing a Find
and Replace once the mereg is completed but I'm idle and want to automate it.

Any help would be much appreciated.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How to ignore a feild in Mail Merge

For the ADDRESSBLOCK
a. which version of Word are you using? If it's Word 2003, there should be
an option in the AddressBlock field dialog box for "Only include the
country/region if different than". However, you would also have to ensure
that you have correctly mapped your country field to the relevant field
(probably Country/Region) in Match fields. If it's Word 2002 I cannot
remember if you get that option - certainly, the ADDRESSBLOCK was less
capable.
b. if you can't get ADDRESSBLOCK to work how you want quite quickly, I'd
stick with the individual fields option. (Some would say "don't use the
ADDRESSBLOCK", period.) Although you can change the behaviour of the
"elements" inside the addressblock to an extent, the behaviour of the
ADDRESSBLOCK is not fully documented and so modifications should not be
regarded as supported. The behaviour of the "fields" in the first line in
particular appears to be "hard-coded". Further, any changes you make
manually will probably be lost the next time you modify the addressblock.

The advantage of the ADDRESSBLOCK is, in theory, that it should get the
general layout of the address right for each country. It's much more
difficult to do that using individual fields unless
a. you know what the layout should be or
b. you use fields that already have the text laid out how you want.

However, when it gets to the country you need something like

{ MERGEFIELD "mypreviousfield"
}{ IF "{ MERGEFIELD country \*Upper }" = "UNITED KINGDOM"
"" "
{ MERGEFIELD country }" }

and for that to work all your United Kingdom addresses would have to be laid
exactly as "United Kingdom", case variations OK, additional spaces, UK, U.K.
not OK).

Peter Jamieson
"Andrew St-Johnston" wrote in
message ...
I have created an address label for Mail Merge. Becasue I wish the City and
Post Code to be bold I have created an address block by inserting all the
relevant fields. It works perfectly. However becasue a small % of the
mailings are going outside the country the last field is "Country". I do
not
want it to print out if the country is "United Kingdom". I can see how to
do
this if I use AddressBlock but I do not know how to get at the fields
within
AddressBlock to change their properties. Just to complicate things my
default
country for Word is USA. I know I can work around the problem by doing a
Find
and Replace once the mereg is completed but I'm idle and want to automate
it.

Any help would be much appreciated.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andrew St-Johnston Andrew St-Johnston is offline
external usenet poster
 
Posts: 3
Default How to ignore a feild in Mail Merge

Thank you for the quick response. Ihave been unsuccessful in modifying
AddressBlock so I am going to try plan B. I hope I am right in assuming that
I just substutute your macro for the country field.

"Peter Jamieson" wrote:

For the ADDRESSBLOCK
a. which version of Word are you using? If it's Word 2003, there should be
an option in the AddressBlock field dialog box for "Only include the
country/region if different than". However, you would also have to ensure
that you have correctly mapped your country field to the relevant field
(probably Country/Region) in Match fields. If it's Word 2002 I cannot
remember if you get that option - certainly, the ADDRESSBLOCK was less
capable.
b. if you can't get ADDRESSBLOCK to work how you want quite quickly, I'd
stick with the individual fields option. (Some would say "don't use the
ADDRESSBLOCK", period.) Although you can change the behaviour of the
"elements" inside the addressblock to an extent, the behaviour of the
ADDRESSBLOCK is not fully documented and so modifications should not be
regarded as supported. The behaviour of the "fields" in the first line in
particular appears to be "hard-coded". Further, any changes you make
manually will probably be lost the next time you modify the addressblock.

The advantage of the ADDRESSBLOCK is, in theory, that it should get the
general layout of the address right for each country. It's much more
difficult to do that using individual fields unless
a. you know what the layout should be or
b. you use fields that already have the text laid out how you want.

However, when it gets to the country you need something like

{ MERGEFIELD "mypreviousfield"
}{ IF "{ MERGEFIELD country \*Upper }" = "UNITED KINGDOM"
"" "
{ MERGEFIELD country }" }

and for that to work all your United Kingdom addresses would have to be laid
exactly as "United Kingdom", case variations OK, additional spaces, UK, U.K.
not OK).

Peter Jamieson
"Andrew St-Johnston" wrote in
message ...
I have created an address label for Mail Merge. Becasue I wish the City and
Post Code to be bold I have created an address block by inserting all the
relevant fields. It works perfectly. However becasue a small % of the
mailings are going outside the country the last field is "Country". I do
not
want it to print out if the country is "United Kingdom". I can see how to
do
this if I use AddressBlock but I do not know how to get at the fields
within
AddressBlock to change their properties. Just to complicate things my
default
country for Word is USA. I know I can work around the problem by doing a
Find
and Replace once the mereg is completed but I'm idle and want to automate
it.

Any help would be much appreciated.




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default How to ignore a feild in Mail Merge

I just substutute your macro for the country field.

More or less. All the {} have to be the special field codes you can insert
using ctrl-F9

Peter Jamieson
"Andrew St-Johnston" wrote in
message ...
Thank you for the quick response. Ihave been unsuccessful in modifying
AddressBlock so I am going to try plan B. I hope I am right in assuming
that
I just substutute your macro for the country field.

"Peter Jamieson" wrote:

For the ADDRESSBLOCK
a. which version of Word are you using? If it's Word 2003, there should
be
an option in the AddressBlock field dialog box for "Only include the
country/region if different than". However, you would also have to ensure
that you have correctly mapped your country field to the relevant field
(probably Country/Region) in Match fields. If it's Word 2002 I cannot
remember if you get that option - certainly, the ADDRESSBLOCK was less
capable.
b. if you can't get ADDRESSBLOCK to work how you want quite quickly, I'd
stick with the individual fields option. (Some would say "don't use the
ADDRESSBLOCK", period.) Although you can change the behaviour of the
"elements" inside the addressblock to an extent, the behaviour of the
ADDRESSBLOCK is not fully documented and so modifications should not be
regarded as supported. The behaviour of the "fields" in the first line in
particular appears to be "hard-coded". Further, any changes you make
manually will probably be lost the next time you modify the addressblock.

The advantage of the ADDRESSBLOCK is, in theory, that it should get the
general layout of the address right for each country. It's much more
difficult to do that using individual fields unless
a. you know what the layout should be or
b. you use fields that already have the text laid out how you want.

However, when it gets to the country you need something like

{ MERGEFIELD "mypreviousfield"
}{ IF "{ MERGEFIELD country \*Upper }" = "UNITED KINGDOM"
"" "
{ MERGEFIELD country }" }

and for that to work all your United Kingdom addresses would have to be
laid
exactly as "United Kingdom", case variations OK, additional spaces, UK,
U.K.
not OK).

Peter Jamieson
"Andrew St-Johnston" wrote
in
message ...
I have created an address label for Mail Merge. Becasue I wish the City
and
Post Code to be bold I have created an address block by inserting all
the
relevant fields. It works perfectly. However becasue a small % of the
mailings are going outside the country the last field is "Country". I
do
not
want it to print out if the country is "United Kingdom". I can see how
to
do
this if I use AddressBlock but I do not know how to get at the fields
within
AddressBlock to change their properties. Just to complicate things my
default
country for Word is USA. I know I can work around the problem by doing
a
Find
and Replace once the mereg is completed but I'm idle and want to
automate
it.

Any help would be much appreciated.






  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andrew St-Johnston Andrew St-Johnston is offline
external usenet poster
 
Posts: 3
Default How to ignore a feild in Mail Merge

Thanks again

"Peter Jamieson" wrote:

I just substutute your macro for the country field.


More or less. All the {} have to be the special field codes you can insert
using ctrl-F9

Peter Jamieson
"Andrew St-Johnston" wrote in
message ...
Thank you for the quick response. Ihave been unsuccessful in modifying
AddressBlock so I am going to try plan B. I hope I am right in assuming
that
I just substutute your macro for the country field.

"Peter Jamieson" wrote:

For the ADDRESSBLOCK
a. which version of Word are you using? If it's Word 2003, there should
be
an option in the AddressBlock field dialog box for "Only include the
country/region if different than". However, you would also have to ensure
that you have correctly mapped your country field to the relevant field
(probably Country/Region) in Match fields. If it's Word 2002 I cannot
remember if you get that option - certainly, the ADDRESSBLOCK was less
capable.
b. if you can't get ADDRESSBLOCK to work how you want quite quickly, I'd
stick with the individual fields option. (Some would say "don't use the
ADDRESSBLOCK", period.) Although you can change the behaviour of the
"elements" inside the addressblock to an extent, the behaviour of the
ADDRESSBLOCK is not fully documented and so modifications should not be
regarded as supported. The behaviour of the "fields" in the first line in
particular appears to be "hard-coded". Further, any changes you make
manually will probably be lost the next time you modify the addressblock.

The advantage of the ADDRESSBLOCK is, in theory, that it should get the
general layout of the address right for each country. It's much more
difficult to do that using individual fields unless
a. you know what the layout should be or
b. you use fields that already have the text laid out how you want.

However, when it gets to the country you need something like

{ MERGEFIELD "mypreviousfield"
}{ IF "{ MERGEFIELD country \*Upper }" = "UNITED KINGDOM"
"" "
{ MERGEFIELD country }" }

and for that to work all your United Kingdom addresses would have to be
laid
exactly as "United Kingdom", case variations OK, additional spaces, UK,
U.K.
not OK).

Peter Jamieson
"Andrew St-Johnston" wrote
in
message ...
I have created an address label for Mail Merge. Becasue I wish the City
and
Post Code to be bold I have created an address block by inserting all
the
relevant fields. It works perfectly. However becasue a small % of the
mailings are going outside the country the last field is "Country". I
do
not
want it to print out if the country is "United Kingdom". I can see how
to
do
this if I use AddressBlock but I do not know how to get at the fields
within
AddressBlock to change their properties. Just to complicate things my
default
country for Word is USA. I know I can work around the problem by doing
a
Find
and Replace once the mereg is completed but I'm idle and want to
automate
it.

Any help would be much appreciated.






Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using if fields in mail merge to ignore empty fields Larry S. Mailmerge 9 August 15th 06 08:10 AM
required feild jis Microsoft Word Help 1 August 10th 05 08:59 PM
Mail Merge - automatic from flat file - how to ignore messages happy_cleo Mailmerge 2 August 2nd 05 09:39 AM
Merge Feild duplicating for 50+ pages BaileyS Mailmerge 1 April 5th 05 09:36 AM
Why do mail merges in word ignore * wildcards in access queries PaulB Mailmerge 0 February 24th 05 10:55 AM


All times are GMT +1. The time now is 06:39 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"