Solved Force BMP to open using PhotoViewer

Jason Lee Hayes

Active member
Local time
Today, 00:44
Joined
Jul 25, 2020
Messages
217
Windows 11
Access 2016 32bit


I have a form with an image control that displayes a picture in BMP format.

I wish to open the BMP when i double click and use the OS Photo Viewer as the default application to open it.

So; you would think i could set the default .bmp extension in OS to open in Photo Viewer but it never does?
Ideally i don't wish to make this perminent either and only wish to use PhotoViewer whilst in my MS Access project.

I am opening the file in MS Access VBA using the Application.FollowHyperlink Method

I can see the PhotoViewer is actually a Dynamic Link Library (.dll) not an executable (.exe)
Its location on my pc is "C:\Program Files\Windows Photo Viewer\PhotoViewer.dll"

I've done some googling and below is the line i likely need to call via shell:-

rundll32 "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen path_to_image

I'm not sure how to call this as a shell command written in VBA

Can anyone help please?
 
I think you almost got it. Try using the Shell command.
 
I think you almost got it. Try using the Shell command.
I've sorted it... Still cannot fathom why i tell my OS to open .BMP in Photo Viewer as default and it does outside of MS Access but within MS Access it just does not work...

I added Shell but then received an argument error - maybe me not adding it correctly so i tried the following which does not specify Photo Viewer and it works?? Maybe Photo Viewer is bound by default to explorer or something... It works anyway....

Call Shell("explorer.exe " & ImagePathSnap, vbNormalFocus)

Thanks for the quick reply theDBGuy

Regards,

Jason
 

Attachments

Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom