VBA code to "Run Application" and open jpg file with path in a fie

G

Guest

I am looking for the correct code for an event procedure for a command button
in a form. I have Access 97. This event procedure should be should be tied to
on "On Click" event.
This code would Run an Application program (in my case paint shop pro) and
would open a specific file (i.e. jpg picture). Only the path of the file
would be stored in a field.
The Command Button Wizard gave me the code for "Run Application" which opens
the Paint Shop Pro just fine.
The subsequent code lines I need is for automatically opening a file in this
application (CTRL-O) and copying the contents of the field (where the path is
stored) I presume.
The intent is to click the command button which would open the paint shop
pro program and which would show the picture.

PS. As you might suspect, I am the newest novice in VBA town.
 
R

Rob Oldfield

application.followhyperlink <pathtoyourfile> will open a file with the
default app

Most apps support usage similar to...

<path>\applicationname.exe <path>\<filetoopen> but you might need to check
PSP for the exact syntax.

....and you can run that by using the shell command.
 
R

Rob Oldfield

....though I can't remember if application.followhyperlink was included in
A97...
 

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