Settings\Wayne\Desktop\SRU2.jpg"""
Single quotes wouldn't work, Paint didn't like them, so I had to double up
the double quotes. The vbmaximizedfocus works on the command window, not the
program that is opening to display the picture, so I would recommend
dropping it off. Of course, since Start doesn't work and you need to specify
a program, then you could skip command.com all together and just specify the
program, then vbmaximizedfocus would work properly.
Actually, I don't know if it is Shell that doesn't like Start or Start that
doesn't like the command line. I just did some testing with Start by typing
directly into a command prompt. If I used quotes around the command line,
Start would just open another command window with the item in quotes as the
title of the window. If I didn't use quotes, then it didn't like the spaces
in the path to the file.
The problem is Start's parameters:
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]
Note the first parameter. The way I got around this was to go:
Start "" "C:\Documents and Settings\Wayne\Desktop\SRU2.jpg"
Then it would start the program.
Even after that though, I still couldn't get Start to work with Shell. It
won't work without command.com, because Shell expects to see an executable
in the command line and it wouldn't work with it, it just gave what you
indicate. I also tried cmd.exe instead of command.com and the command window
stayed open, but still no picture program.
What would probably work better would be an api call to launch or find the
default program.
This link should show how to launch the default program.
http://www.mvps.org/access/api/api0018.htm
This link should show how to find the default program so that you could then
use it in your Shell statement.
http://www.mvps.org/access/api/api0023.htm
--
Wayne Morgan
MS Access MVP
Rick said:
I'm currently working second hand on a application that
has an image on a form. User wants to be able to double
click on image open full size window with image.
I've used Shell command.com /cStart "photo path",
vbmaximizedfocus
This opens a window but it immediately closes.
Are there any parameters that will keep it open until
user decides to close it or even another way to
accomplish same goal.
Any help greatly appreciated.
Thanks,
Rick
.