Results 1 to 13 of 13
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    AddressLayout Syntax (Any)

    <PR_GIVEN_NAME> <PR_SURNAME>
    {{<PR_COMPANY_NAME>
    }{<PR_STREET_ADDRESS>
    }<PR_LOCALITY> | {<PR_STREET_ADDRESS>
    }<PR_LOCALITY>}, <PR_STATE_OR_PROVINCE> <PR_POSTAL_CODE>

    The above "code" when selected and added as the autotext entry "AddressLayout"
    will cause contacts or address book entries to insert into Word (via application.getaddress
    or the Insert Address toolbar button) so that a blank Company name will not cause a
    blank line between the name and address. That's wonderful. But my aching head
    cannot figure out how in the world the braces and the vertical bar account for the
    if-then-else logic that produces the intended result. Is there a sharp mind out there
    who can inform me as to how this works?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: AddressLayout Syntax (Any)

    Kevin,

    I don't understand the example either. The braces around field + soft return are intended to suppress the soft return if the field is empty. I would guess the vertical bar is the equivalent of OR, but as I said, I do't really understand this. I seems to me that the "code" as given should be equivalent to<pre><PR_GIVEN_NAME> <PR_SURNAME>
    {<PR_COMPANY_NAME>
    }{<PR_STREET_ADDRESS>
    }<PR_LOCALITY>, <PR_STATE_OR_PROVINCE> <PR_POSTAL_CODE></pre>

    where each line exept the last should be terminated by a soft return (Shift+Enter).

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    The vertical bar does indeed mean "or". But the syntax is quite puzzling.
    I should post to the Puzzles forum next. Gee wiz.

    Here's a link. Take a look: http://support.microsoft.com/default.aspx?...B;en-us;209752&

    Remember, all, Q articles no longer have the Q prefix. (What is MS doing???)
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    I think I got it!

    The purpose to all this is to be able to use the Insert Address button in Word
    to insert addresses formatted correctly if

    1) The recipient has no Title
    2) The recipient has no Company

    The following AddressLayout autotext will do just that for contacts stored
    in an Exchange Public Contacts folder: (Eureka!)

    {{<PR_DISPLAY_NAME>}, <PR_TITLE> | {<PR_DISPLAY_NAME}}
    {{<PR_COMPANY_NAME>
    }{<PR_STREET_ADDRESS>
    }<PR_LOCALITY>| {<PR_STREET_ADDRESS>
    }<PR_LOCALITY>}, <PR_STATE_OR_PROVINCE> <PR_POSTAL_CODE>

    The trick (I think) is to construct the entry with braces around the part that
    * MUST NOT * be blank. If anything in braces before the "or" (vertical brace)
    is blank the stuff after the bar (and before the ending brace) shows up.

    At last, the Insert Address functionality is actually useful!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    Spoke too soon. That's not it. It still prints the comma before the blank title.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    I think maybe now I've got it!

    Check this out. The if-then logic works because of the brace grouping
    on <PR_DISPLAY_NAME> and <PR_TITLE> making one compound field.



    {{{<PR_DISPLAY_NAME>}{, <PR_TITLE>}}|<PR_DISPLAY_NAME}
    {{<PR_COMPANY_NAME>
    }{<PR_STREET_ADDRESS>
    }<PR_LOCALITY>| {<PR_STREET_ADDRESS>
    }<PR_LOCALITY>}, <PR_STATE_OR_PROVINCE> <PR_POSTAL_CODE>

    Create the AddressLayout autotext entry with the above in it. Using the
    Insert Address button, insert a name in your address book that has
    a Title and a Company. Now insert an entry that does not have a Title
    or Company. Both addresses should insert without blank lines or
    an unnecessary comma.

    This was one elusive beast. I've googled for a couple years on and off
    trying to find some way to make that Insert Address button useful.

    Anyway, rejoice with those who rejoice
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. #7
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: AddressLayout Syntax (Any)

    Hi Kevin,
    I've been following this with interest. One (picky) point about your logic is that (if I read it correctly) it seems to be predicated on the address always having the recipient's name, but not necessarily the recipient's title. If so, it will fail if you've got a title, but no name to go with it (eg The Chairman, Widgets Corp). <img src=/S/bummer.gif border=0 alt=bummer width=15 height=15>
    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  8. #8
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    Entering only a title creates a save error message within Outlook which cannot easily index the resulting record.
    It WILL save it, but only under sufferance. Most people, I think, would file the examples given in the name field anyway.

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    Glad to know this thread generated some interest. It's been a bear to discover what
    little I know.

    I think you are right; however, there are no such entries in our Address Lists. So, we're
    safe. It would not be hard (at least I feel confident that I could attempt it with a reasonable
    shot at success) to account for a no-name.

    Why don't you give it a shot?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    That's a helpful point. In order to get the display_name to work, you can just
    put the title info in on of the name-part fields. That'll be standard practice
    if you don't want to see the error message.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. #11
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: AddressLayout Syntax (Any)

    Give it a shot eh?
    Well, I've never used this feature and don't have anything set up to test it with, but following your example it seems the syntax for the first line would change from
    {{{<PR_DISPLAY_NAME>}{, <PR_TITLE>}}|<PR_DISPLAY_NAME>} Note the final chevron - I think you missed it.
    to something like
    {{{<PR_DISPLAY_NAME>}{, <PR_TITLE>}}|{<PR_DISPLAY_NAME>}|<PR_TITLE>}
    How am I doing so far?
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    I haven't tested it, but it looks good!
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  13. #13
    Star Lounger
    Join Date
    May 2003
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: AddressLayout Syntax (Any)

    Thanks for this info. I actually addressed another issue...what if there is a second address i.e suite #? I modified the layout to look like this:
    {{{<PR_DISPLAY_NAME>}{
    <PR_TITLE>}}|<PR_DISPLAY_NAME}
    {{<PR_COMPANY_NAME>
    }{<PR_POSTAL_ADDRESS>}

    using the "postal address" takes care of the second address. I also added a manual line break inside the bracket before "title" (thereby putting the title on the next line.
    Thanks everyone!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •