Solved

How to sync with word documents from Access database

Posted on 2011-02-11
6
402 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

896 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

18 Experts available now in Live!

Get 1:1 Help Now