I am trying to open a mail merge document using the below code. It opens the word document, but it is no longer a mail merge document. Can anyone assist me with what I would need to change in order for the mail merge to work?
Private Sub OpenWord(FileName As String)
Dim WordObj As Object
Set WordObj = CreateObject("Word.Basic")
WordObj.FileOpen FileName
WordObj.AppShow
End Sub
Private Sub Command75_Click()
On Error GoTo Err_Command75_Click
Dim stAppName As String
OpenWord ("C:\Program Files\MinistryCheck\attachments\insuranceproposal2.doc")
Exit_Command75_Click:
Exit Sub
Err_Command75_Click:
MsgBox Err.Description
Resume Exit_Command75_Click
End Sub
I did try the method below and was able to get the mail merge to work, however the database is placed on individuals hard drives. There will be over 100 different users, so I know that the path for the winword.exe may not always be the same, thus causing me a problem.
Dim gsFile As String
Dim successful
gsFile = "C:\Program Files\MinistryCheck\attachments\insuranceproposal2.doc"
successful = Shell("C:\Program Files\Microsoft office\Office11\WINWORD.EXE " & _
" /t" & Chr(34) & gsFile & Chr(34), vbMaximizedFocus)
Thanks
Arob
Private Sub OpenWord(FileName As String)
Dim WordObj As Object
Set WordObj = CreateObject("Word.Basic")
WordObj.FileOpen FileName
WordObj.AppShow
End Sub
Private Sub Command75_Click()
On Error GoTo Err_Command75_Click
Dim stAppName As String
OpenWord ("C:\Program Files\MinistryCheck\attachments\insuranceproposal2.doc")
Exit_Command75_Click:
Exit Sub
Err_Command75_Click:
MsgBox Err.Description
Resume Exit_Command75_Click
End Sub
I did try the method below and was able to get the mail merge to work, however the database is placed on individuals hard drives. There will be over 100 different users, so I know that the path for the winword.exe may not always be the same, thus causing me a problem.
Dim gsFile As String
Dim successful
gsFile = "C:\Program Files\MinistryCheck\attachments\insuranceproposal2.doc"
successful = Shell("C:\Program Files\Microsoft office\Office11\WINWORD.EXE " & _
" /t" & Chr(34) & gsFile & Chr(34), vbMaximizedFocus)
Thanks
Arob