M
MarkD
Using Access 2000.
I created a sub that will do a mail merge from Access into
Word. I pass the document name and the query name. The
code written below is taken from Microsoft (Q209976).
For some reason, it takes several minutes to bring up the
Word document. The query is small (1 record) and running
the mail merge from Word itself is pretty much instant.
So, what gives?
Thanks!
-Mark
Sub CreateWordDocument(strDocName As String, Optional
strQueryName As String)
Dim objword As Word.Document
Set objword = GetObject(strDocName)
objword.Application.Visible = True
objword.MailMerge.OpenDataSource _
Name:=CurrentDb.Name, _
Connection:="Query " & strQueryName,
'sqlstatement:="select * from " & strQueryName
'code fails whether above is commented or not.
objword.MailMerge.Execute
End Sub
I created a sub that will do a mail merge from Access into
Word. I pass the document name and the query name. The
code written below is taken from Microsoft (Q209976).
For some reason, it takes several minutes to bring up the
Word document. The query is small (1 record) and running
the mail merge from Word itself is pretty much instant.
So, what gives?
Thanks!
-Mark
Sub CreateWordDocument(strDocName As String, Optional
strQueryName As String)
Dim objword As Word.Document
Set objword = GetObject(strDocName)
objword.Application.Visible = True
objword.MailMerge.OpenDataSource _
Name:=CurrentDb.Name, _
Connection:="Query " & strQueryName,
'sqlstatement:="select * from " & strQueryName
'code fails whether above is commented or not.
objword.MailMerge.Execute
End Sub