Solved

How to sync with word documents from Access database

Posted on 2011-02-11
6
403 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cannot Link Master/Child Fields in a Navigation data sheet Sub Form 1 31
User Level Security 6 38
Office 2016 Temp Files 3 30
IIF help, YN field 7 22
My experience with Windows 10 over a one year period and suggestions for smooth operation
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

778 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