I am running A2K and the error I get states "File name or class name not found during Automation Operation . "
Private Sub Open_Merge_WordDoc(strPath As String)
Dim strDocument As String
Dim objWord As Word.Document
Set objWord = GetObject(" & strPath & ",
"Word.Document")
'*** 'iT 'FAILS 'RIGHT 'HERE 'wHEN '''' 'gEToBJECT IS CALLED ***
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the
personnel database.
objWord.MailMerge.OpenDataSource _
Name:="C:\GHN\GHNWordData.mdb", _
LinkToSource:=True, _
Connection:="QUERY qryDailyLetters"
' Execute the mail merge.
objWord.MailMerge.Execute
end sub
****************
The string strPAth works fine when I use the shell command
shell "winword.exe " Chr(34) & strPath
Private Sub Open_Merge_WordDoc(strPath As String)
Dim strDocument As String
Dim objWord As Word.Document
Set objWord = GetObject(" & strPath & ",
"Word.Document")
'*** 'iT 'FAILS 'RIGHT 'HERE 'wHEN '''' 'gEToBJECT IS CALLED ***
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the
personnel database.
objWord.MailMerge.OpenDataSource _
Name:="C:\GHN\GHNWordData.mdb", _
LinkToSource:=True, _
Connection:="QUERY qryDailyLetters"
' Execute the mail merge.
objWord.MailMerge.Execute
end sub
****************
The string strPAth works fine when I use the shell command
shell "winword.exe " Chr(34) & strPath