Results 1 to 6 of 6
  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: Merge 1 Address (2003)

    I believe Word's concept of a mail merge always creates a new document. If you don't want a new document, you could use automation to open the Excel workbook behind the scenes, locate the correct entry, retrieve the data, close the workbooks, and insert the data into your document.

    There probably are examples of this in the Lounge, for both Excel and Access. However, if your Excel sheet changes infrequently, you also could consider importing it into a new temporary Contacts folder, setting that folder up as an Outlook Address book, and accessing it through the Address Book dialog. If it changes frequently (i.e., more than once a week), then you're probably better off working on some new code.

  2. #2
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Merge 1 Address (2003)

    Thanks for the input. We are trying to avoid the Outlook Address book option, there are too many variables as to how they set up the data display, preferences, etc. I think we will go with creating a dialog box from the Excel file for them to choose the name to insert. I am just such a novice, it will take me a while to do that, even with the good examples out there.

  3. #3
    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: Merge 1 Address (2003)

    I didn't realize this was for multiple people. Do you have Exchange Server? Maybe you could hook up the Address Book dialog to a public folder of contacts? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    But seriously, someone might come along with a suggestion for automating Excel. If not, I'll move this thread over to the VBA board and see if that helps.

  4. #4
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Merge 1 Address (2003)

    Again, thanks for the suggestions. All of these people work remotely from their home office, so currently I develop Word global templates for each client we have and they just load the template they need. Immediately I will just have them open the Excel file and copy and paste while I get the dialog box programmed. There are several examples of how to access Excel data from Word and that is what I'll do. I still wish there was a way to do it with the mail merge from Word, but I spent some time on and and could not get it to work. You can move this to the VBA board just in case someone knows how to do it. Otherwise, I'll use the other solution.

  5. #5
    2 Star Lounger
    Join Date
    Jul 2003
    Location
    Park City, Utah
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Lookup in Excel workbook, insert to Word doc(2003)

    <P ID="edit" class=small>(Edited by jscher2000 on 27-Apr-05 10:26. Subject line changed in preparation for moving to VBA board. Please read down the thread for more information.)</P>I would like a macro that uses mail merge to insert 1 address into the current cursor location similar to the Address Book function, only using merge with another data source (which in this case will always be an Excel file of names and addresses). It seems that someone likely has already written something like this, if so, please point me in the right direction. If not, if anyone can still point me in the right direction to get started that would be great.

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

    Re: Merge 1 Address (2003)

    I have attached a zip file with a Word document and an Excel workbook. The Word document contains merge fields, but it has been disconnected from the data source. The Excel workbook contains a userform to let the user select an item for the mail merge. The merge is then initiated from Excel in VBA.
    To test, unzip both files, then open the Excel workbook, and modify the path in the strDoc constant in cmdOK_Click in the module belonging to the userform. Switch back to Excel and click the button.
    If you want to copy the code to your own workbook, you must also modify the other two constants, as well as the row source of the combo box on the form.

Posting Permissions

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