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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Image with vba 1

Status
Not open for further replies.

Bigpapou

Programmer
May 23, 2001
41
CA
I need to open(preview) an image... I have the full path (path\image.jpg). Don't mind if it open in a msgbox... as long as it open.

I'm working with "docmd" but I haven't been able to do anything right... for now. Anyone have an idea!!!

Thank
 
I just did this via opening up MicorSoft Paint from Access. I created a "View Pic" button. On click:
stAppName = "C:\WINNT\system32\mspaint.exe " & FileName
Call Shell(stAppName, 1)

where FileName = Path and Name of file to display
 
The next lines of code open ms photo editor but not the picture I want to be opened.

stAppName = "C:\Program Files\Fichiers communs\Microsoft Shared\PhotoEd\Photoed.exe" & "PathPicture"
Call Shell(stAppName, 1)

What am I doing wrong???
 
If "PathPicture" is a variable, you will have to remove the double quotes around it.

I.E.

stAppName = "......" & PathPicture

Also, if your PathPicture has Spaces in it you may need to include quotes:

stAppName = "......" & chr$(34) & PathPicture & chr$(34)

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top