Consulting

Results 1 to 3 of 3

Thread: How to Open a Picture using Windows Photo Gallery

  1. #1
    VBAX Mentor
    Joined
    Jan 2008
    Posts
    384
    Location

    How to Open a Picture using Windows Photo Gallery

    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

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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

  3. #3
    VBAX Mentor
    Joined
    Jan 2008
    Posts
    384
    Location
    Thanks Kenneth Hobs:

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

    Again: Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •