open word doc from access

G

Guest

I want to set up a macro in access which opens a specific word document. I
can see how to open word as an application but not a specific doc. Is this
possible or will my users have the locate the doc themselves? BTW the word
doc is a mail merge with the data source being a table my access database.

Note I am using macros because I don't do the whole VBA thing.

Rob
 
G

Guest

Hi,
try to adapt VBA. Macros are very limited and cannot handle error handling.
You can then simply use the followhyperlink method on the on click event of a
command button if you want or some other event:

Application.FollowHyperlink "c:\path to your file\yourfile.doc"

HTH
Good luck
 
B

bob

This code works for me

Function OpenWordDocGen(strDocName As String)
Dim ObjApp As Object
'opens the doc
Set ObjApp = CreateObject("Word.application")
ObjApp.Visible = True
ObjApp.Documents.Open strDocName
End Function


call it from a button for example : OpenWorkDocGen ("path to document")
 
S

Steve Schapel

Rob,

To do this in a macro, use a RunApp action. The syntax of the Command
Line argument will be something like this...
"C:\Program Files\Microsoft Office\Office\Winword.exe"
"C:\YourFolder\YourDoc.doc"
 

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