Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a mail merge document from access form

Status
Not open for further replies.

Arob

Technical User
Jul 25, 2001
55
0
0
US
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

 
And what about this ?
Application.FollowHyperlink "C:\Program Files\MinistryCheck\attachments\insuranceproposal2.doc"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top