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

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
....though I can't remember if application.followhyperlink was included in
A97...
 
Back
Top