open word doc from access

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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")
 
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"
 
Back
Top