Solved: Open word doc with command button in access

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jmk909er

Thread Starter
Joined
May 20, 2009
Messages
354
Is there a simple way to open a word doc with a command button in access?
 

karlhaywood

Account Closed
Joined
Jan 17, 2010
Messages
680
If your going to open the same word doc everytime you press the button you could try

Dim LWordDoc As String
Dim oApp As Object
'Path to the word document
LWordDoc = "c:\Doc1.doc"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject(Class:="Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open filename:=LWordDoc
End If
End Sub

You will need to put in the correct file path of the document you want to open.
 

jmk909er

Thread Starter
Joined
May 20, 2009
Messages
354
Thanks Guy's I found a solution:

Private Sub Command30_Click()
Application.FollowHyperlink "T:\G4\Maint\Fac Reports\M2R2Weekly Planning Status xcel document\MCRD Projects\MCRD Projects Input Worksheet.doc"
End Sub
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top