I have a database with images stored externally (with only the paths stored in the database). I want to create a button that would open a picture with the user's default picture viewer (eg. Ms Photo Editor, Ms Paint, Photoshop etc.).
Is there anyway that I can simulate the double click of a jpg file in windows from within my program (so that it would open it with the default viewer). If not, I would just like to make it open with mspaint.
I have tried fiddling around with the shell command to get it to open with paintbrush:
Call Shell(("C:\WINDOWS\System32\mspaint.exe C:\database\images\a picture.jpg"), vbMaximizedFocus)
for some reason, as soon as you have a space in the path (like "a picture", or "C:\documents and settings" etc) Paintbrush returns an error becuase it doesn't like the space. If I change the code to open photoshop instead it works fine with the space. The trouble is that I have to get it working with paintbrush if nothing else. Any ideas?
Thanks very much,
Peter
Is there anyway that I can simulate the double click of a jpg file in windows from within my program (so that it would open it with the default viewer). If not, I would just like to make it open with mspaint.
I have tried fiddling around with the shell command to get it to open with paintbrush:
Call Shell(("C:\WINDOWS\System32\mspaint.exe C:\database\images\a picture.jpg"), vbMaximizedFocus)
for some reason, as soon as you have a space in the path (like "a picture", or "C:\documents and settings" etc) Paintbrush returns an error becuase it doesn't like the space. If I change the code to open photoshop instead it works fine with the space. The trouble is that I have to get it working with paintbrush if nothing else. Any ideas?
Thanks very much,
Peter