OnClick Command does not word with Vista

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
 
B

boblarson

Glad I could help! Merry Christmas!
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top