Button To Run Word File

ivie_brasil

New member
Local time
Today, 12:25
Joined
Nov 23, 2006
Messages
3
I tried to use wizard to build a button that will run a file from WORD. but it doesn't seem to work.
When i'm on wizard for runapplication, it even gives an example.
Excel.exe c:\Travel\trips.xls

Anybody could help me?
 
Word

I tried this code in the OnClick Event of a command button in Access 2000 and it worked just fine....


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
 

Users who are viewing this thread

Back
Top Bottom