Best forum for Access (or VBA / VB) using Automation of Word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have found information on Word Automation to be very sparce indeed on the
web. Can someone point me to a good forum or website or book that covers this
subject in GREAT detail.
For instance the following code statement takes between 10 and 15 seconds to
execute and I wish to reduce that to no more than 2 seconds.

oWordDoc.MailMerge.OpenDataSource _
Name:="XYZ.mde", _
LinkToSource:=True, _
Connection:="QUERY " & strDataSource, _
SQLStatement:="SELECT * FROM " & strDataSource & strCriteria

It basically sets up a feed of ONE record's data into a Word doc that has
been setup as a MailMerge document.

I could post this question to the Word MailMerge forum, however previously I
have found there is very little automation experience there.
 
Automation is by nature slow -
you have to open an instance of Word, and even just doing that often
takes several seconds.
Mail merges are especially slow, in my experience.

Are you sure you can't do what you need with an Access report?

If you really need to use Word automation, MailMerge may be overkill for a
single record.
An alternative technique is to create unique bookmarks at each location
where you need to insert text.
If you name the bookmarks the same as the fields in your query, it's
relatively easy to loop through them and insert the text.
You still have to open your instance of Word, though, so it will take some
time.

HTH
 
Back
Top