Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launching a program with parameters

Status
Not open for further replies.

Seeff

Programmer
Dec 2, 2002
33
IL
Hi Experts,

I have a thumbnail image in a form. When I click on the image I want to run an external program (some photo viewer or other) and have the viewer open the image.

The RunApp command in a macro does not have the option to pass a parameter. How do I do this with code?

Thanks for your help,

Laurence
 
Use the Shell command
Shell("the path of the Photo Viewr" "path of the file",1)
 
Thanks...I figured it would be a simple solution. I even got the Windows picture and fax viewer (that hidden app) to work just fine. For those intrersted the command line:

rundll32.exe %Systemroot%\system32\shimgvw.dll,ImageView_Fullscreen
 
You can use FollowHyperlink to open your default editor/viewer, too.

[tt]FollowHyperLink "C:\Dir\Image.jpg"[/tt]
[tt]FollowHyperLink Me.txtImagePath[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top