vba顯示圖片文件

Sub Button1_Click()
    Dim sht As Worksheet, rng As Range, picPath As String
    Set sht = ActiveSheet
    Set rng = ActiveCell
    If sht.Cells(1, rng.Column) <> "文件" Then Exit Sub

    picPath = rng.Value
    
    Shell "rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_Fullscreen " & picPath, vbNormalFocus
End Sub

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章