windows function to run software

R

Roy Goldhammer

Hello there

Is there a way to run function from access that get name and path of file
and run software according to the file extention?
 
R

Roy Goldhammer

Whell Steve

In shell function i can run any software on my computer

But i can't run simple text, excel or word file without applying the
softeware name.

For example:
this runction cause error:
shell("C:\text.txt")
could not find file:

but if i run it like this:
shell("Notepad C:\text.txt") it run great

i need global function that will run the software according to its
extention:

so i can also run function like this:
shell ("C:\text.pdf") and adobe reader will run
 
S

Steve

Hi Roy,

We could make the Shell function work but here's another idea --

You don't need a global function; just some code in the click event of a
button:
Dim FilePath As String
<< Use the Dir function to get the path >>
FilePath = .....
Application.FollowHyperlink FilePath

Lookup the Dir function in the Help file.

Steve
 
Top