Solved

How to sync with word documents from Access database

Posted on 2011-02-11
6
401 Views
Last Modified: 2012-05-11

Hello, I have an associate that would like to populate an Access database (with data and also with backend forms/controls/VB, reports) and either create (from scratch) or populate (using templates of some sort?) microsoft word documents (not Access reports, actual word docs) that contain slices of the data.

I undertook a similar task several years ago, accessed the Word API from VB to generate word documents in memory and then save them to disk.  This was very slow, and the wrong choice.  I'm sure there have been evolutions in interoperability since then, I'm just out of touch.

Anyway, since I chose wrong previously and didn't know till the end, thought I'd ask first: can anyone recommend an approach to this?  

(We are in the middle of migrating, but I think we want to assume the Office 2007 suite.)

Thanks very much in advance.
0
Comment
Question by:riceman0
6 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 125 total points
ID: 34874061

  Attached is a sample Access DB that from the Access side, inserts data into a Word Template at bookmarked locations.  Is along the lines of what your looking for and should work in A2007 without any real changes.

JimD.
mmA2002.zip
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 34874152
Firstly, such techniques are probably not version-dependent.

The principle (no-code) method to populate word documents from Access is to use Mail Merge. If you are using this function, then it will still work with the upgrade.

Otherwise, I think that we need more information.
0
 
LVL 31

Assisted Solution

by:Helen_Feddema
Helen_Feddema earned 125 total points
ID: 34874287
See my old code sample #24 (Four Ways to Merge to Word):

http://www.helenfeddema.com/Files/code24.zip

Or my more recent ebook, Working with Word, available from Office Watch, for techniques useful in Word 2007 and up.  There are many ways to fill Word docs with data from Access -- Bookmarks, Doc Properties, Doc Variables, TypeText and MailMerge.  MailMerge generally requires an active link to the database, which can be problematic, though you can avoid this by exporting the data to a text file and linking the Word merge doc to that file.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 21

Assisted Solution

by:Boyd (HiTechCoach) Trimmell, Microsoft Access MVP
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 125 total points
ID: 34874342
I like to use this: Super Easy Word Merge

I find it much more user friendly and easier to use than bookmarks for most users..
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 125 total points
ID: 34877981
I think I misread the question. You will need some code to populate Access from Word.

The difficulty is in finding the data that is need from the document.

If you are starting from scratch, then it would be best to use forms documents. This requires controls to receive the data from the user. For compatibility with 2003 and earlier, you would need Forms controls. Otherwise Content controls are available.

Second best is to use tables to define the data to be read.

If the documents already exist, you may need some complex parsing.

If you host the application in Word, you can use ADO, so that there is no need to open an Access application. To  drive from Access you will have to create or open an instance of Word and then open the relevant document(s).
0
 

Author Closing Comment

by:riceman0
ID: 34879293
Thanks for the pointers all.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now