D
DennisB
Hi
I am trying to start a Word email mailmerge from Access 2003 by clicking a
command button macro.
I have a module containing the Mergit () function.
The macro uses "OpenModule" to call the function.
The function contains this code:
Function MergeIt()
Dim objWord As Word.Document
Set objWord = GetObject("C:\CPS\Letters\EMember Newsletter Notification",
"Word Document")
'Make Word Visible.
objWord.Application.Visible -True
'Set the mail merge data source as CPS.
objWord.MailMerge.OpenDataSource _
Name:="C:\CPS\CPS Source\CPS.mdb", _
LinkToSource:=True, _
Connection:="QUERY Active EMembers", _
SQLStatement:="SELECT * FROM [Active EMembers]"
objWord.MailMerge.Execute
End Function
All that happens is that the Module opens for editing.
Can someone tell me where I'm being stupid?
Thanks
Dennis
I am trying to start a Word email mailmerge from Access 2003 by clicking a
command button macro.
I have a module containing the Mergit () function.
The macro uses "OpenModule" to call the function.
The function contains this code:
Function MergeIt()
Dim objWord As Word.Document
Set objWord = GetObject("C:\CPS\Letters\EMember Newsletter Notification",
"Word Document")
'Make Word Visible.
objWord.Application.Visible -True
'Set the mail merge data source as CPS.
objWord.MailMerge.OpenDataSource _
Name:="C:\CPS\CPS Source\CPS.mdb", _
LinkToSource:=True, _
Connection:="QUERY Active EMembers", _
SQLStatement:="SELECT * FROM [Active EMembers]"
objWord.MailMerge.Execute
End Function
All that happens is that the Module opens for editing.
Can someone tell me where I'm being stupid?
Thanks
Dennis