Results 1 to 15 of 15
  1. #1
    emb40
    Guest

    Addresses for Letters (Word/Outlook 2000 SR1)

    We recently converted to Word and using Outlook. Would like to use names and addresses in Outlook's Public Folders/Contacts in letters created in Word. We have customized template for letters so we can copy a name and address to paste into the letter. Don't do mass mailings - just individual letters. This process has worked well for us using Office Accelerator (a database program) but so far haven't found a way to copy Outlook's names and addresses into a Word letter. Any ideas/suggestions would be appreciated. Thanks

  2. #2
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    You can add the Address Book button to the toolbar. Tools/Customize/Commands tab. It's under the Insert category and the command is "address book..."

    There is a knowledge base article on changing the way the address is laid out in the document (it includes the country). Here it is: <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q212/3/45.ASP?LN=EN-US&SD=gn&FR=0&qry=q212345&rnk=1&src=DHCS_MSPSS_gn_ SRCH&SPR=OUT98>WD2000: How to Modify the Layout of an Address Book Entry</A>
    egghead

  3. #3
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    You can use the letter Wizard. Save them as templates with "Letter" in their names and put them in the folder "Letters & Faxes" in your user or workgroup templates folder. (You may have to create this folder.)
    The letter template should have the following in an AutoText entry named AddressLayout (all one word):
    <PR_DISPLAY_NAME>
    <PR_STREET_ADDRESS>
    <PR_LOCALITY>, <PR_STATE_OR_PROVINCE> <PR_POSTAL_CODE>
    (You may be able to cut and paste the above into your document. If you do, use Paste-Special... Unformatted text.) Actually, I think that the AutoText entry can be in a global template (including Normal.dot) but am not sure of this.
    For more information on this, I would recommend that you read the instructions in <A target="_blank" HREF=http://www.amazon.com/exec/obidos/ISBN=0789718421/balancecheckbookA/> Special Edition Using Office 2000</A> by Ed Bott and Woody Leonhard (Que), pp. 312-318, 763-764. That gives a listing of the different codes that Word recognizes as well as a macro for getting rid of the "United States of America" in the built-in templates. They also recommend starting the letter from Word rather than from Outlook and give instructions on how to do this.

    If you buy <A target="_blank" HREF=http://www.amazon.com/exec/obidos/ISBN=0789718421/balancecheckbookA/> the book</A>, a side-benefit is that the CD-ROM contains WOPR-2000 which lets you right-click in a document and call up your contacts list to insert names and addresses from the Contacts folder.

    Hope this helps,
    Charles Kyle Kenyon
    Madison, Wisconsin

  4. #4
    New Lounger
    Join Date
    Jun 2001
    Location
    Hamburg
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    I bought the "Special Edition", read The Microsoft KB-Article and today also posted a question on the Outlook Forum, but so far haven't found an answer for this problem:
    How to format fields in the AutoText entry ?
    For example i would like the PR_COMPANY_NAME always to be inserted with a BIG-letter format. Could you maybe tell me, if there is a way to assign a permanent format to the Autotext or if i have to do the formating always manually after the text has been inserted.
    Any answer will be very appreciated.

  5. #5
    New Lounger
    Join Date
    Feb 2001
    Location
    Lake Saint Louis, Missouri, USA
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    In your Main Document, select the company name field - including the << and >> bits - and format the selection with a larger-size font, color, whatever you want. If you want all caps, or small caps, do that via Format | Font. Save the Main Document. The formatting in the Main Document goes into the created document when you do the mail merge.

  6. #6
    New Lounger
    Join Date
    Jun 2001
    Location
    Hamburg
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Sorry, i think i should have clarified my problem better. I am not doing a mail merge, but trying to use the "Address Book" button to insert a special address layout from Outlook. I made an AutoText entry, so when the address is inserted only the fields, which i put in the AutoText, are chosen:

    {<PR_COMPANY_NAME>
    }{<PR_GIVEN_NAME>} {<PR_SURNAME>
    }{<PR_STREET_ADDRESS>

    }{<PR_POSTAL_CODE>} {<PR_LOCALITY >
    }{<PR_COUNTRY>}

    And here it seems no to be possible to assign a format to the fields. I tried to format the field, but when the address is inserted it will always be without the format. Even though "normal" AutoText would include formating.

    Still, thank you very much for your answer.

  7. #7
    New Lounger
    Join Date
    Aug 2001
    Location
    Dallas, Texas, Texas, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Have you tried formatting that line with a style? I have noticed that styles attach nicely to autotext. <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

  8. #8
    New Lounger
    Join Date
    Jun 2001
    Location
    Hamburg
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Yes, i tried.
    Unfortunately all formatting will not work with the AutoText entry "AddressLayout".
    Word is inserting addresses from Outlook via "AddressLayout" always with "Standard" format. No matter which format is used in the document or was used for the AutoText entry.

    Thanks for your suggestion.

  9. #9
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Why are you using fields rather than the non-field descriptor method?

    <PR_COMPANY_NAME>
    <PR_GIVEN_NAME> <PR_SURNAME>
    <PR_STREET_ADDRESS> ...

    You can format the first line in a different style than the remaining lines. Then select the entire address and save it as your AutoText entry.

    Have you installed WOPR from the CD-ROM?

    -- Sorry -- I just tested my own suggestions and they don't make any difference. Even though the AT entry is formatted correctly, the inserted text ignores the formatting. You may be stuck with using a mail merge solution.
    Charles Kyle Kenyon
    Madison, Wisconsin

  10. #10
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    It sounds like you are using a macro to insert a formatted Autotext Entry. What is probably missing is the RichText tag in the InsertAutotext line.

    I don't have WOPR but assume it is being used to bring in the autotext entry. I also assume that it is locked down so you can't edit the VBA code. If this is the case, see if you can harass the makers to provide a fix. If this not the case and you can edit the VBA, then you could search in this forum for "RichText" to see how it is used in code to bring in Autotext entries with their formatting.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  11. #11
    New Lounger
    Join Date
    Jun 2001
    Location
    Hamburg
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Hm??
    Well, actually i am a newbie and can not write VBA. <img src=/S/weep.gif border=0 alt=weep width=21 height=16>
    What i did was just typing some fieldnames and inserting them as the AutoText entry 'AddressLayout'. So always when i am hitting the Address Book button, an address - with the fields i chose before - will be inserted in the document.
    With a mail merge i indeed can insert contact information and control the format very well. But using the Address Book button to get an Outlook address (with the fields i want !) would have been extremely nice and fast. Unfortunately i wouldn't know how to add a RichText Tag to that AutoText.

    Andrew and Chas, thank you very much for thinking about my problem! <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

  12. #12
    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: Addresses for Letters (Word/Outlook 2000 SR1)

    Try this. It will insert an address using the layout you described in one of your earlier messages, with the first line bumped up 4 points in size.
    <pre>Sub MyInsertAddress()
    ' Jefferson Scher 2/4/02
    Dim strLayout As String, strAddress As String
    ' Define layout using fields listed in help under AddAddress
    strLayout = "<PR_COMPANY_NAME>" & vbCrLf & _
    "<PR_GIVEN_NAME> <PR_SURNAME>" & vbCrLf & _
    "<PR_STREET_ADDRESS>" & vbCrLf & _
    "<PR_POSTAL_CODE> <PR_LOCALITY>" & vbCrLf & _
    "<PR_COUNTRY>"
    ' Pop up the address book dialog, indicating that results
    ' should be returned using our custom layout
    strAddress = Application.GetAddress(vbNullString, strLayout)
    ' If user cancels, address is blank, so we would want to exit
    If strAddress = vbNullString Then Exit Sub
    ' Set up string array so we can style inserted text as we wish
    Dim strArray() As String, intCounter As Integer
    ' Slice and dice address string into array
    strArray() = Split(strAddress, vbCrLf)
    ' Ready to insert...
    With Selection
    ' Collapse selection to insertion point, just in case
    .Collapse wdCollapseEnd
    ' Step through array inserting text and styling as desired
    ' Requires modification to match the custom layout!
    For intCounter = 0 To UBound(strArray)
    ' Use a large font size for the first line (arrays
    ' generated by Split always count up from zero)
    If intCounter = 0 Then
    .Font.Size = .Font.Size + 4
    .TypeText strArray(intCounter)
    .Font.Size = .Font.Size - 4
    .TypeParagraph
    Else
    ' Insert all nonblank lines
    If strArray(intCounter) <> vbNullString Then
    .TypeText strArray(intCounter) & vbCrLf
    End If
    End If
    Next
    End With
    End Sub</pre>

    If you have not saved a macro from the Lounge before, you can try the method I described in <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=wrd&Number=112915>Post #112915</A>. Becuase I used PRE tags to format the code in this post, you need to first paste it into the body of a Word document before pasting it into a code window (otherwise it often ends up on one long line).

  13. #13
    New Lounger
    Join Date
    Jun 2001
    Location
    Hamburg
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Dear Jefferson,

    thank you very much for your help. <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Because i never learned VB, it was fun to change some code by trial and error. <img src=/S/joy.gif border=0 alt=joy width=23 height=23>
    I am not sure if i will ever learn VB and i am deeply impressed by the expertise in this lounge.

    Could i ask for your help once more?
    In the third line i would like the <PR_DISPLAY_NAME_PREFIX> only not to be bold. Of course i could change the format after the macro was executed, but if there is a relative short way to change the code, it would be fantastic.
    I didn't know how to change this code, as the IF intCounter... is only formating a whole line.

    Sub Adressen_Insert()
    ' Jefferson Scher 2/4/02
    Dim strLayout As String, strAddress As String
    ' Define layout using fields listed in help under AddAddress
    strLayout = "<PR_COMPANY_NAME>" & vbCrLf & _
    "<PR_TITLE>" & vbCrLf & _
    "<PR_DISPLAY_NAME_PREFIX> <PR_GIVEN_NAME> <PR_SURNAME>" & vbCrLf & _
    "<PR_STREET_ADDRESS>" & vbLf & vbLf & _
    "<PR_POSTAL_CODE> <PR_LOCALITY>" & vbCrLf
    ' Pop up the address book dialog, indicating that results
    ' should be returned using our custom layout
    strAddress = Application.GetAddress(vbNullString, strLayout)
    ' If user cancels, address is blank, so we would want to exit
    If strAddress = vbNullString Then Exit Sub
    ' Set up string array so we can style inserted text as we wish
    Dim strArray() As String, intCounter As Integer
    ' Slice and dice address string into array
    strArray() = Split(strAddress, vbCrLf)
    ' Ready to insert...
    With Selection
    ' Collapse selection to insertion point, just in case
    .Collapse wdCollapseEnd
    ' Step through array inserting text and styling as desired
    ' Requires modification to match the custom layout!
    For intCounter = 0 To UBound(strArray)
    If intCounter = 0 Or intCounter = 2 Then
    .font.Bold = True
    .TypeText strArray(intCounter)
    .TypeParagraph
    Else
    ' Insert all nonblank lines
    If strArray(intCounter) <> vbNullString Then
    .font.Bold = False
    .TypeText strArray(intCounter) & vbCrLf
    End If
    End If
    Next
    End With
    End Sub

    Please excuse my impudent request.

  14. #14
    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: Addresses for Letters (Word/Outlook 2000 SR1)

    It's fun, isn't it?

    Well, the problem you pose is a hard case. It requires having some certainty about the existence and form of the prefix. For example, will there always be one and will it never have an internal space? If the answer is yes, then you can handle different parts of the string (the array element) separately by locating the first space:
    <pre>For intCounter = 0 To UBound(strArray)
    If intCounter = 0 Then
    .Font.Bold = True
    .TypeText strArray(intCounter)
    .TypeParagraph
    ElseIf intCounter = 2 Then
    .Font.Bold = False
    ' Type in the stuff up to and including the first space
    .TypeText Left(strArray(intCounter), InStr(1, strArray(intCounter), " "))
    .Font.Bold = True
    ' Type in the stuff after the first space to the end
    .TypeText Right(strArray(intCounter), _
    Len(strArray(intCounter)) - InStr(1, strArray(intCounter), " "))
    .TypeParagraph
    Else
    ' Insert all nonblank lines
    If strArray(intCounter) <> vbNullString Then
    .Font.Bold = False
    .TypeText strArray(intCounter) & vbCrLf
    End If
    End If
    Next</pre>

    If, as in my case, there is no prefix, then the safer way would be to have the GetAddress function return the prefix as a separate line, and treat that line as a special case by not using .TypeParagraph after inserting the prefix. If the prefix is blank, do nothing, and if it is not blank, type it in and follow it with a space.

  15. #15
    New Lounger
    Join Date
    Jun 2001
    Location
    Hamburg
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Addresses for Letters (Word/Outlook 2000 SR1)

    Hi Jefferson,

    to tell the truth, there where lots of more errors then successful results, but it is fun and i do not mind the hours i spent at all. <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    Unfortunately i have to work on a external project for the next days/weeks and will not be able to continue playing with VB. I will do as soon as the project is over.

    Again: thanks a lot for all your help! <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>

Posting Permissions

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