Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    GetAddress Woes (VBA/Word 2000)

    Hello All,

    I seem to be unable to extract the Courtesy Title "<PR_COURTESY_TITLE>" from my Outlook Address Book/Contacts list. Word's VBA help says it supports this address property and I also have a book (Word 2000 VBA - Programmer's Reference) that also says it supports this property. Any suggestions:

    Here is my code:

    strSalutation = "Dear " & Application.GetAddress(, "<PR_COURTESY_TITLE>", , 2) & " "
    strSalutation = strSalutation & Application.GetAddress(, "<PR_SURNAME>", , 2) & ":"
    gofrmLetter.cmbSalutation.Text = strSalutation

    Thank you.

    Kyle

  2. #2
    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 Woes (VBA/Word 2000)

    It's hard to test with your snippet; this one allows you to select a "John" from the list:
    <pre>Sub TestGetAddress()
    Dim strSalutation As String
    strSalutation = "Dear " & Application.GetAddress("John", _
    "<PR_COURTESY_TITLE>", False, 0) & " "
    strSalutation = strSalutation & Application.GetAddress(, _
    "<PR_SURNAME>", False, 2) & ":"
    MsgBox strSalutation
    End Sub</pre>

    Doesn't work and I don't know why not. I'm using Word 2000 and Outlook 2000, and my primary address book is a PAB. PAB records have no space for a PR_COURTESY_TITLE. Even if I select my secondary address book (an Outlook Contacts folder) and a record that has a PR_COURTESY_TITLE, it doesn't work. I'm mystified.

    After a run through Google Groups, I was led to Sue Mosher's page Inserting Addresses into Microsoft Word Documents, where she has a workaround using a different field: <PR_DISPLAY_NAME_PREFIX> . It does seems to work with Outlook Contacts folders. Since I can't find any place to stick this kind of title in my PAB, I assume it doesn't work with those. Yahoo! (so to speak) Slipstick to the rescue yet again.

  3. #3
    Star Lounger
    Join Date
    Jan 2003
    Location
    San Francisco, California, USA
    Posts
    93
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: GetAddress Woes (VBA/Word 2000)

    Thank you so much. I used PR_Display_Name_Prefix and it worked!

Posting Permissions

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