Results 1 to 6 of 6
  1. #1
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862

    Export to Word Doc Table

    Nothing fancy here. Early binding is used to open a Word Doc, create a table in the doc, Export data from a query object to the table, save the Word Doc, Close the word doc.



    Because early binding is used it may be easy to add formatting, sizing, etc.

    Oh, and never mind the goofy name I gave the word doc within the sample DB. I originally tried to use a Mail Merge connection to populate the table but gave up on that idea.
    Attached Files Attached Files

  2. #2
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212
    Wow! I appreciate all the effort you have gone to. If I go quiet for a while it's because I'm processing all the info you have given me, but I'm quite sure that I am making huge progress towards my goal. Thanks very much

  3. #3
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212
    I have a couple of questions. Can DAO be used across all versions of Office?

    Having successfully got the code to pull in the results of a multi-row query, I would like to be able to leave a space in the document and then pull in a second table. Whatever I try seems to overwrite. Would I use Range or possibly Bookmarks to achieve this? Thanks.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have never tried anything like that. I would not be surprised if it is possible. Maybe adding an excel object to your Word doc and then linking said object to Access is easiest.

    I will suspect connecting to Access from Word will place the Access file in Exclusive mode.

  5. #5
    Abacus1234 is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    212
    Thanks for the response. I don't understand the benefit of adding an Excel object. Generally, I would not want to complicate things on the users end by adding another piece of software into the mix. The actual data that I need could be found in one file, although I would need to format into 3 sections. I need somehow to create totals for the three sections and put them in a row at the beginning of the section not the end. That's what comes of providing government forms, they are not particularly logical. Thanks very much for your help.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Abacus1234 View Post
    ...I don't understand the benefit of adding an Excel object. Generally, I would not want to complicate things on the users end by adding another piece of software into the mix...
    Then I suggest using Access to export data to the Word Doc and be done with it. There is an example of how to do this in post #1. If you need to format the table, use early binding and the instantiation of objects to access Format properties of the table object.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export to Word
    By dagwood in forum Import/Export Data
    Replies: 1
    Last Post: 05-09-2013, 05:20 PM
  2. Export report to Word
    By Lowell in forum Reports
    Replies: 1
    Last Post: 02-06-2013, 11:54 PM
  3. Export to Word
    By Monterey_Manzer in forum Import/Export Data
    Replies: 0
    Last Post: 12-20-2012, 02:06 PM
  4. Export report to word document
    By jackyoung2012 in forum Reports
    Replies: 1
    Last Post: 03-16-2012, 11:16 AM
  5. Replies: 7
    Last Post: 08-31-2010, 12:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums