Macro in MS Access 2000 to open a MSWord 2000 document.

J

Jas Micro

I can only find how to open an excel reports, but how can I create a macro in
Access where I can press a button and open a Word document.
 
D

Doug Robbins - Word MVP

Dim WordApp As Object
Dim WordDoc As Object

' this code assumes Word is running
On Error GoTo CreateWordApp
Set WordApp = GetObject(, "Word.Application")

Set WordDoc = wordApp.Documents.Open("path\filename")

CreateWordApp:
' This code launches Word if it was not running
Set WordApp = CreateObject("Word.Application")
Resume Next


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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