Word - Easiest, Leanest Way to Incorporate Conditionals and Exclude USA? (Word 2007)

Asked By RJRJ on 12-Jun-10 07:04 PM
My data source has a check-box for "Address is Business." When the box
is checked-in (True), then I want to include the person's job title
and company name.

I also want to exclude the country name when the address is within the
USA.

Here is my conundrum:

- How do I edit Word's built-in Address Block to include the
conditional statements? I tried but was unsuccessful; so either it is
not possible or I am doing something wrong.

* OR *

- In my "hand-rolled" address block, how do I suppress the USA and --
ideally -- any of its variations (US, U.S., USA, U.S.A., United
States)?

The built-in address block has this code (ellipsis indicate text
snipped from the example):

{ADDRESSBLOCK \f "<<_SALUTE>> ...

I do not know and have been unable to find out what the switches mean.

However, I guessed (perhaps wrongly) that  " \e "USA" \d " means
adding those switches to my hand-rolled address block. Nada. No
effect.

So to re-cap/paraphrase:

1. How do you edit the built-in ADDRESS BLOCK to contain conditional
statements?

2. What is the switch or switches to suppress USA and its variations
when creating your own address block?

3. If either or both of the above are possible, then I kindly request
syntactically complete examples, and alerts if special keys or key
sequences are needed.

Thank you!


Doug Robbins - Word MVP replied to RJRJ on 12-Jun-10 08:29 PM
The switches that can be used with the AddressBlock field have the following
effects:

\c    Specifies whether to include the name of the country/region
\d    Specifies whether to base address format on the destination
country/region
\e    Specifies the excluded country/region name
\f    Specifies the name and address format
\l    Specifies the language id used to format the address

In you case, however, you are not going to be able to use the AddressBlock
field and will have to make use of the individual mergefields together with
If...then...Else fields in constructions such as the following for which you
must use Ctrl+F9 to insert each pair of field delimiters

{ IF { MERGEFIELD "Address is Business" } = True "{ MERGEFIELD Title }?
{ MERGEFIELD ComanyName }?
{ MERGEFIELD Street }" "{ MERGEFIELD Street }" }

Where the pilcrows (?) appear in the above field construction (at the end of
the first and second lines), press Enter or Shift+Enter



--
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
RJRJ replied to Doug Robbins - Word MVP on 13-Jun-10 08:21 PM
Doug, thank you for your well-crafted (expert!) explanation.

For those who are reading this post and wondering about the
pilcrows ... in this context, they are the markers/symbols for hard or
soft paragraphs. You likely do not see the markers in this post. You
would see them in Word if you make your character, etc. formatting
visible.

RJRJ