48Highlander
Technical User
I am trying to execute a mail merge from access using a very complex query which is based on two previous queries. When I execute this mail merge manually from Word, I have to get access to this query via DDE as detailed in the following MS KB article:
When the following code executes, I get a message that Word cannot find the query. Note that the document I reference already has a link to the query via DDE.
Has anyone got any ideas how I can get this to work? I am not familiar with connection methods such as OBDC but if that is what I have to learn, so be it.
Bill J
When the following code executes, I get a message that Word cannot find the query. Note that the document I reference already has a link to the query via DDE.
Code:
Public Function MergeIt()
Dim odoc As Word.Document
Dim objWord As Object
Dim DataSource, Connection, CurrentPath As String
CurrentPath = CurrPath
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set odoc = objWord.Documents.Add(CurrentPath & "\" _ Me.cboLetterSelect.Column(3))
odoc.MailMerge.OpenDataSource Me.cboLetterSelect.Column(4)
odoc.MailMerge.Execute
'odoc.PrintOut
End Function
Has anyone got any ideas how I can get this to work? I am not familiar with connection methods such as OBDC but if that is what I have to learn, so be it.
Bill J