bonjour,
je veux ouvrir un fichier pdf par du vba access, j'ai parcouru le forum je n'ai trouvé que ce code.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" _
(ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
en tête de module puis dans le module
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Private Sub OuvrirPdf()
 
  Dim strAcroPath As String, strFichier As String
  Dim intPage As Integer
 
  strAcroPath = String(128, 32)
  strFichier = "ca269" 'A COMPLETER
  intPage = 3 'A COMPLETER
 
  If FindExecutable(strFichier, vbNullString, strAcroPath) <= 32 Then
    MsgBox "Adobe Acrobat Reader n'a pas été trouvé sur cet ordinateur", vbOKOnly + vbCritical, "Message d'erreur"
  Else
    strAcroPath = Left$(strAcroPath, InStr(strAcroPath, Chr$(0)) - 1)
    Shell strAcroPath & " /a page=" & intPage & " " & strFichier, vbNormalFocus
  End If
 
End Sub
quand je lance la fonction, il me répond qu'il ne trouve pas le programme adobe reader (j'ai sans doute fait une erreur d'accepter la mise à jour en adobe reader 11)
quelqu'un a-t-il la solution?
merci par avance