Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Special Mail Merge (Office XP)

    I need to start with a bit of extraneous material before I get to my question. Please bear with me, it is so you have the whole picture.

    I have an access database that contains all the data for creating an Operations and Maintenance Manual. This is a huge couple of folders that are handed over with the plant on completion in a commercial project.

    Whilst I could manipulate Word from Access to create my O & M Manual, as I am the user I have elected to take a simpler path and create a flat file I use as the data source for the majority of this document. This works fine and I have no issue with this.

    Where I am having an issue is in the table at the bottom of the document. I have a table set up that contains Manufacturer and Model for every unit and a list of other attributes that vary in quantity and complexity depending on the item in question. Having thought about this I think the best approach would be a macro of some sort in word. I would see this macro performing something like the following:

    Grab the ItemDetailID for the Mail Merge data Word is currently using
    Open a query (always the same name) in Access passing in the ItemDetailID as the Criteria
    Finding the Manufacturer and Model and pushing this data into the Word Table
    Finding any other data in the recordset and creating the cells and adding the data to the Word Table

    Problem is I have not worked in Word at all, and I don't even know if this is possible.

    Could someone please help me out with either an example macro that I could modify to suit or alternatively a different approach that should achieve the same outcome?

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

    Re: Special Mail Merge (Office XP)

    How many records will be returned by the query when you pass ItemDetailID as criteria? Just one, or could there be multiple records?

  3. #3
    New Lounger
    Join Date
    Jan 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Special Mail Merge (Office XP)

    There could be multiple records, I cannot determine the record count as it varies from product to product

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

    Re: Special Mail Merge (Office XP)

    I would recommend you have a look at code samples on Helen Feddema's website. In the section entitled Access >>> Word there is a demonstration of importing an Access query into a Word Table.
    Code Samples
    Andrew Lockton, Chrysalis Design, Melbourne Australia

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

    Re: Special Mail Merge (Office XP)

    Why don't you include the query in the flat data source for the mail merge? You could then use the techniques as described in How to use mail merge to create a list sorted by category in Word 2002 and WD2000: How to Work Around Duplicate Names in Mail Merge Data.

    Also see Mail Merge FAQ

Posting Permissions

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