Affichage d'un fichier PDF

Bonjour à tous,

Je voudrais créer un Userform avec une zone de liste déroulante.

Je voudrais qu'à chaque fois que je choisisse un élément de la liste déroulante, un fichier PDF correspondant à l'élément choisi s'ouvre.

Merci par avance.

Bonjour,

Solution trouvée sur internet (remerciements à HansV MVP). Mets ce code en tête d'un module (important) :

Private Declare PtrSafe 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

Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWNORMAL As Long = 1

Adapte ensuite la macro qui affiche le PDF :

Sub OpenPDF()
    If ShellExecute(Application.hwnd, "Open", "C:\fichier.pdf", 0&, 0&, SW_SHOWNORMAL) < 33 Then
        MsgBox "Couldn't open PDF file.", vbInformation
    End If
End Sub

Si tu as des difficultés à le faire, poste le classeur.

Daniel

Rechercher des sujets similaires à "affichage fichier pdf"