Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub afficherImage_ApercuWindows()
'Testé avec Excel2002 et WinXP
'force l'affichage de l'image avec "L'aperçu des images et des télécopies windows".
Dim Img As String
'choix du dossier
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Image JPEG", "*.jpg"
If .Show <> 0 Then
Img = .SelectedItems(1)
Else
Exit Sub
End If
End With
'puis ouvrir l'image avec la visionneuse
ShellExecute 0, "open", "rundll32.exe", _
"C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen " & Img, 0, 1
End Sub