Results 1 to 10 of 10
  1. #1
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy 1 field into another (2000/SR1-a)

    Hi,
    My ultimate goal is to have Word print names & addresses the way I want. I have a database of names, addresses etc. in Access. The address is the home address.

    I exported them into Outlook (or imported from Outlook, I can't recall). All the addresses have only a home address. When I use the address book button in Word, it leaves the address blank.

    I've figured out that if I were to import the Home Address field in Outlook to say, the Office_Location field, I could then redefine the AutoText entry (AddressLayout) in Word to enter the address the way I want.

    HOWEVER, I don't know how to copy 1 field to another en masse (i.e. for the entire address book). I would appreciate any advice as to how I can do this?

  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: Copy 1 field into another (2000/SR1-a)

    Wish granted: the procedure in Post 65048 copies the home address to the business address. To prevent the prompt froom popping up each time, it needs to be restructured so that it is in an Else clause, with all the assignments pushed into a separate subroutine. At least that's how it looks tonight.

    Edit: Fixed post link @ June 4, 2009

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy 1 field into another (2000/SR1-a)

    Hi Jefferson:
    Thank you very much, but I must be missing something. I copied the macro to a module in Outlook & ran it. But it didn't copy the home addresses into the business addresses. I have the contacts open when I run the macro. Also, the line "Attribute VB_Name = "Lounge" at the top causes an error so I commented it out. I'm not sure what I should do. Could you elaborate, as I'm not very familiar with Outlook.

  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Roanoke area, Virginia, USA
    Posts
    3,729
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy 1 field into another (2000/SR1-a)

    you can redefine the address field to use any address - i have mine set up to use home if exists, but to use office if it doesn't exist. I'll have to dig up the format i used - i did it when i switched to ol2000 because field names changed between it and ol98. <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    if this is a one time deal, export to excel, make the changes and import. it's a lot faster (and safer) than messing with a VBA solution if you only need to do it once.

  5. #5
    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: Copy 1 field into another (2000/SR1-a)

    Phil, that top line is there because I posted the module as a .BAS file for easy importing. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    I'm not sure what is going wrong. For testing, create a new contacts folder and copy one of your contacts that has a home address into it. Then, while viewing that folder in the OL interface, step through the macro with the de######, and stop after the first call to Save. Open the contact and . . . nothing?? Very strange.

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy 1 field into another (2000/SR1-a)

    Hi Jefferson:

    I ran the wrong macro. <img src=/S/doh.gif border=0 alt=doh width=15 height=15> I redid it & it worked! Thanks a lot. Now I realized that I never imported the fields for City & State so I need to reimport. Nevertheless, this really did the trick.

    Thanks again. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

    Mary:
    Thank you for your idea with Excel. I will give that a shot too.

  7. #7
    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: Copy 1 field into another (2000/SR1-a)

    Phil, that's great. However, I just looked at the code and must apologize for moving rather than copying your home addresses. I hope you have a backup, or don't need them in their original location. Or that you saw this coming and commented out the second set of lines that cleared all those fields. If you need to copy them back, you could write a macro that looks at the modification time and for those that just got modified today, copies back the address to the home fields.

    This should do the test part:

    If .LastModificationTime > Date Then

    Because Date has no time component, it is equivalent to the stroke of midnight "this morning."

  8. #8
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy 1 field into another (2000/SR1-a)

    Hi Jefferson:
    It did delete the home address, but don't worry.
    1) I always keep backups (but I don't know what this file would be called. I don't have any *.pab files. If you know the extension, please let me know.)
    2) I need to redo the import from Access. Somehow, I didn't import the city & state fields originally, only the street address & zip. So I need to delete them & reimport. Then I'll run your macro after commenting out the delete lines.

    It's amazing that Microsoft didn't give more compatibility between Outlook & Word. You'd think they'd allow all the possible Outlook fields to be used in Word. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

  9. #9
    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: Copy 1 field into another (2000/SR1-a)

    Phil, 99% sure your addresses are in a Contacts folder inside a .PST and not in a separate .PAB file.

    Try something else: look for the option in Outlook to designate the Home address as the Mailing Address. These articles hint that Word will then pick it up.

    <A target="_blank" HREF=http://support.microsoft.com/default.aspx?scid=kb;EN-GB;q211424>WD2000: Matching AddressLayout Fields to Outlook Contact Fields (Q211424)</A>
    <A target="_blank" HREF=http://support.microsoft.com/default.aspx?scid=kb;en-us;Q211553>WD2000: Word Cannot Retrieve the Business Address from Outlook (Q211553)</A>
    Attached Images Attached Images

  10. #10
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy 1 field into another (2000/SR1-a)

    Hi Jefferson:
    Thanks for all the help. Your 99% answer was 100% true. I located the outlook.pst file, deleted all my extra contacts (after making a backup, just in case), & then re-imported from Access. Then I ran your macro, after remming out the delete lines. It worked perfectly! I owe ya a beer <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

    I had created an AutoText entry "AddressLayout". However, I soon deleted it as unnecessary. The new problem was that every time that I typed the word address, the yellow autocomplete tip popped up. After deleting the entry, the address book still worked as it should. It seems that Word has a hidden AutoText entry "AddressLayout" that doesn't appear in the list.

Posting Permissions

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