Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jas Micro - 23 Aug 2006 19:18 GMT
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.
Doug Robbins - Word MVP - 23 Aug 2006 21:25 GMT
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

Signature

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

>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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.