Results 1 to 3 of 3
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: GetAddress Method (word97)

    Can you work around it with Selection.TypeText or Selection.InsertAfter, or is the problem specifically in the GetAddress function call? (I don't have Word 97 handy, sorry.)

    Oops, never mind. See Microsoft Knowledge Base Article 167381 - WD97: GetAddress Method Without Name Argument Causes IPF: you need a Name:="" parameter.

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

    Re: GetAddress Method (word97)

    Excellent sleuthing Mr. Holmes. And thanks much!
    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>

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

    GetAddress Method (word97)

    In Word 97 this causes Word to crash:

    Create an AddressLayout autotext to format addresses
    inserted via the Insert Address button. Name the autotext
    "MyLayout" or whatever. See below for examples.
    Now, either in a sub or in the immediate window type

    selection.text = application.getaddress (AddressProperties:="MyLayout", UseAutoText:=True)
    ************************************************** ************************************************** ******************
    [Edited: Here's the correct syntax after applying fix from Jefferson's post]:

    selection.text = application.getaddress (Name:="",AddressProperties:="*AddressLayout", UseAutoText:=True)
    ************************************************** ************************************************** *******************

    When you run the above code, Word 97 will abend.

    In Word 9, 10 and 11 it works fine. Could someone confirm for me
    that this a Word 97 problem?

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

    or more simply, like this:
    <PR_GIVEN_NAME> <PR_SURNAME>
    <PR_OFFICE_TELEPHONE_NUMBER>
    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>

Posting Permissions

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