Function OpenPdf(ByVal sPath As String, Optional ByVal lNumPage As Long = 1, Optional ByVal WindowStyle As VbAppWinStyle = vbNormalFocus) As Boolean
' cette fonction nécessite la fonction GetExePathFileFromExtention disponible ici :
' http://www.codyx.org/snippet_recuperer-chemin-programme-associe-fichier-apres-son-extension_544.aspx#1708
Dim sExe As String
sExe = GetExePathFileFromExtention("pdf")
If LenB(sExe) Then
On Error Resume Next
OpenPdf = (Shell(sExe & " /A page=" & CStr(lNumPage) & " " & sPath, WindowStyle) > 0)
End If
End Function