OnClick Command does not word with Vista

  • Thread starter Thread starter Wissam
  • Start date Start date
W

Wissam

Hi,
I have an access 2000 database that I created on my work computer (has
microsoft access 2003) and has a form with a command button to open a
microsoft word file. This works well on my computer at work (has windows XP;
microsoft access 2003 and word 2003). I transfered the file to my personal
laptop windows vista; has microsoft 2007). On the properties of the command
button, I adjusted the path of the word document I want the On_click button
to open. In addition, I added the reference in the module to microsoft word
12.0. However, when I click the command button on the form, nothing happens.
I would appreciate it if you help me with suggestions to fix this problem.
Thanks.

The following is the code I am using:

Private Sub RunWord_Click()
On Error GoTo Err_RunWord_Click
Dim objword As Word.Application
Set objword = CreateObject("Word.Application")
'Make it visible.
objword.Application.Visible = True
'Open the document.
objword.Documents.Open ("C:\Test merge.doc")
Exit_RunWord_Click:
Exit Sub
Err_RunWord_Click:
MsgBox Err.Description
Resume Exit_RunWord_Click
End Sub
 
Back
Top