PDA

View Full Version : [SOLVED] How to Open a Picture using Windows Photo Gallery



simora
08-28-2019, 01:44 AM
I am trying to open a Picture using the Windows Photo Gallery.
I can select the Picture name in a cell, and it gets the correct picture, and Photo Gallery is selected; but I have to click on the Folder in the bottom of the screen to see the Picture.
Is there a way to get Gallery to actually Open so that I can see the picture.
Here's my code;



Sub OpenAPic()
Dim sFile As String
Dim MyFile As String
MyFile = ActiveCell
sFile = "C:\People Folder\"

Shell "RunDLL32.exe C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen " & sFile & ActiveCell.Text
End Sub

Kenneth Hobs
08-28-2019, 08:16 AM
If not married to using RunDLL32:


Sub OpenAPic()
Dim sFile As String, MyFile As String, s As String
MyFile = ActiveCell
sFile = "C:\People Folder\"
's = "RunDLL32.exe C:\Windows\System32\Shimgvw.dll,ImageView_Fullscreen " & _
"""" & sFile & ActiveCell.Text & """"
s = "cmd /c " & """" & sFile & ActiveCell.Text & """"
Shell s, vbNormal
End Sub

simora
09-05-2019, 09:32 AM
Thanks Kenneth Hobs:

I was away for a little while. The solution works and opened the desired file in a window.

Again: Thanks