
Access 97 to Word Mail Merge Automation
I'm trying to merge two fields (FirstName, LastName) from a table in
Access 97 with a memo document in Word 97 using Automation. The example
code that I have found using DDE mailmerge uses Word as the Controller
and Access as the Server.
I need to do this using Access as the Controller and Word as the Server
instead. I have following code in an Access module.
With objWord.ActiveDocument
.MailMerge.OpenDataSource Name:="d:\database\database.mdb",
LinkToSource:=True, Connection:="TABLE tblUsers", SQLStatement:="SELECT
* FROM [tblEmployees] WHERE [Exempt] = True AND [Visitor]=False ORDER
BY [LastName], [FirstName]"
.MailMerge.Execute
End With
This works, but the merge process is very slow. It merges one record
about every second or less. The CPU is pegged at 100% during the merging
plus about 15 seconds afterwards. I only have about 50 records that get
merged.
Is there a better method for my situation? It seem like I'm trying to
open a database that I'm already in which is causing the problem?.
Any suggestions is appreciated.
Brad
Please remove NoSpaM from e-mail