PDA

View Full Version : Picture and Fax viewer



mdmackillop
03-08-2006, 04:36 AM
Does anyone know a shell command to open Windows Picture and Fax Viewer. I wanting pass a bmp file name, to view it. Any other solutions welcome.
Regards
MD

Marcster
03-08-2006, 04:53 AM
This in Windows Run box will open it:
rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen

Marcster.

Marcster
03-08-2006, 05:20 AM
To open a picture file say, C:\test.bmp:
rundll32.exe %SystemRoot%\system32\shimgvw.dll,ImageView_Fullscreen C:\test.bmp

Looking at %SystemRoot%\system32\shimgvw.dll in the Object Browser
There's a Class called Preview with a method:
ShowFile(bstrFileName As String, iSelectCount As Long)

There's other methods, events etc which look like
you can manipulate with VBA,
but as yet, unable to get it to work.

HTH,

Marcster.

mdmackillop
03-08-2006, 05:29 AM
Thanks Marcster,
I'll have a look at these.
Regards
Malcolm

Marcster
03-08-2006, 05:57 AM
If you add the
Preview Class
to Additional Controls on the Toolbox in the VBE
you can add the Picture Viewer to a user form
whereby you can maniuplate it.
For example:
Me.Preview1.ShowFile "c:\test.bmp", 1

Marcster.