Compare Mailing_Address with Business_Address that includes countr

H

Heliotrope

This question derives from the helpful exchange "Conditionally print outlook
company in mail merge (4/22/06)."

I tried the suggested solution but found that when Business_Address includes
the country, the routine fails. Here's the key part:
{IF "{ MERGEFIELD "Mailing_Address" }" = "{ MERGEFIELD "Business_Address" }"
"{MERGEFIELD "Company"}. How do I programatically remove the country from
Business_Address before making the comparison?
 
D

Doug Robbins - Word MVP

There is no way that you are going to be able to do that with mailmerge.
You maybe able to do something with a Catalog (or Directory) type mailmerge
main document that you would use to create a Word document containing all of
the data and then do some processing on the contents of that document and
then use it as the data source for a mailmerge.

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

Heliotrope

well --- Thanks! Glad I asked - you saved me much time barking up a wrong tree.
 
M

macropod

Hi Heliotrope,

Actually, you don't need to *remove* the country from Business_Address
before making the comparison. All you need to do is to code the field to
disregard it.

An IF test with a wildcard will do the trick. The field construction is:
{IF{MERGEFIELD Business_Address}= "{ MERGEFIELD Mailing_Address }*"
{MERGEFIELD "Company"}}

Cheers
 
H

Heliotrope

Thank you very much. Unfortunately, I could not get this suggestion to work,
though I tried several permutations in addition. I get inconsistent results -
even one where with no business address at all the compnay name showed up. (I
know that's odd) Could this have to do with the character set? I noticed the
Word file conversion dialogue shows Unicode.

Thanks!

macropod said:
Hi Heliotrope,

Actually, you don't need to *remove* the country from Business_Address
before making the comparison. All you need to do is to code the field to
disregard it.

An IF test with a wildcard will do the trick. The field construction is:
{IF{MERGEFIELD Business_Address}= "{ MERGEFIELD Mailing_Address }*"
{MERGEFIELD "Company"}}

Cheers
--
macropod
[MVP - Microsoft Word]


Heliotrope said:
This question derives from the helpful exchange "Conditionally print outlook
company in mail merge (4/22/06)."

I tried the suggested solution but found that when Business_Address includes
the country, the routine fails. Here's the key part:
{IF "{ MERGEFIELD "Mailing_Address" }" = "{ MERGEFIELD "Business_Address" }"
"{MERGEFIELD "Company"}. How do I programatically remove the country from
Business_Address before making the comparison?
 
M

macropod

Hi Heliotrope,

The fact you got a case where with no business address at all the company
name showed up suggests there may be something wrong with your data source.
There's no reason I can see why the code would work as advertised. The
presence of Unicode characters shouldn't change that, though I admit I don't
quite know how Word treats them if they appear in the data preceding the
country.

Cheers

--
macropod
[MVP - Microsoft Word]


Heliotrope said:
Thank you very much. Unfortunately, I could not get this suggestion to work,
though I tried several permutations in addition. I get inconsistent results -
even one where with no business address at all the compnay name showed up. (I
know that's odd) Could this have to do with the character set? I noticed the
Word file conversion dialogue shows Unicode.

Thanks!

macropod said:
Hi Heliotrope,

Actually, you don't need to *remove* the country from Business_Address
before making the comparison. All you need to do is to code the field to
disregard it.

An IF test with a wildcard will do the trick. The field construction is:
{IF{MERGEFIELD Business_Address}= "{ MERGEFIELD Mailing_Address }*"
{MERGEFIELD "Company"}}

Cheers
--
macropod
[MVP - Microsoft Word]


Heliotrope said:
This question derives from the helpful exchange "Conditionally print outlook
company in mail merge (4/22/06)."

I tried the suggested solution but found that when Business_Address includes
the country, the routine fails. Here's the key part:
{IF "{ MERGEFIELD "Mailing_Address" }" = "{ MERGEFIELD "Business_Address" }"
"{MERGEFIELD "Company"}. How do I programatically remove the country from
Business_Address before making the comparison?
 
H

Heliotrope

Well, thanks anyway. Exchange Server/ Outlook 2003 otherwise seem solid.

macropod said:
Hi Heliotrope,

The fact you got a case where with no business address at all the company
name showed up suggests there may be something wrong with your data source.
There's no reason I can see why the code would work as advertised. The
presence of Unicode characters shouldn't change that, though I admit I don't
quite know how Word treats them if they appear in the data preceding the
country.

Cheers

--
macropod
[MVP - Microsoft Word]


Heliotrope said:
Thank you very much. Unfortunately, I could not get this suggestion to work,
though I tried several permutations in addition. I get inconsistent results -
even one where with no business address at all the compnay name showed up. (I
know that's odd) Could this have to do with the character set? I noticed the
Word file conversion dialogue shows Unicode.

Thanks!

macropod said:
Hi Heliotrope,

Actually, you don't need to *remove* the country from Business_Address
before making the comparison. All you need to do is to code the field to
disregard it.

An IF test with a wildcard will do the trick. The field construction is:
{IF{MERGEFIELD Business_Address}= "{ MERGEFIELD Mailing_Address }*"
{MERGEFIELD "Company"}}

Cheers
--
macropod
[MVP - Microsoft Word]


This question derives from the helpful exchange "Conditionally print
outlook
company in mail merge (4/22/06)."

I tried the suggested solution but found that when Business_Address
includes
the country, the routine fails. Here's the key part:
{IF "{ MERGEFIELD "Mailing_Address" }" = "{ MERGEFIELD
"Business_Address" }"
"{MERGEFIELD "Company"}. How do I programatically remove the country
from
Business_Address before making the comparison?
 
P

Peter Jamieson

One thing to look out for is a 128-ish character limit on comparisons - that
would be a lot for addresses but it depends on how much is in the address.

Peter Jamieson
macropod said:
Hi Heliotrope,

The fact you got a case where with no business address at all the company
name showed up suggests there may be something wrong with your data
source.
There's no reason I can see why the code would work as advertised. The
presence of Unicode characters shouldn't change that, though I admit I
don't
quite know how Word treats them if they appear in the data preceding the
country.

Cheers

--
macropod
[MVP - Microsoft Word]


Heliotrope said:
Thank you very much. Unfortunately, I could not get this suggestion to work,
though I tried several permutations in addition. I get inconsistent results -
even one where with no business address at all the compnay name showed
up. (I
know that's odd) Could this have to do with the character set? I noticed the
Word file conversion dialogue shows Unicode.

Thanks!

macropod said:
Hi Heliotrope,

Actually, you don't need to *remove* the country from Business_Address
before making the comparison. All you need to do is to code the field
to
disregard it.

An IF test with a wildcard will do the trick. The field construction
is:
{IF{MERGEFIELD Business_Address}= "{ MERGEFIELD Mailing_Address }*"
{MERGEFIELD "Company"}}

Cheers
--
macropod
[MVP - Microsoft Word]


This question derives from the helpful exchange "Conditionally print
outlook
company in mail merge (4/22/06)."

I tried the suggested solution but found that when Business_Address
includes
the country, the routine fails. Here's the key part:
{IF "{ MERGEFIELD "Mailing_Address" }" = "{ MERGEFIELD
"Business_Address" }"
"{MERGEFIELD "Company"}. How do I programatically remove the
country
from
Business_Address before making the comparison?
 

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