Lister les documents pdf ouverts

matmi

XLDnaute Nouveau
Bnjour à tous,

Je suis à la recherche d'une solution pour lister dans un fichier Excel tous les documents .pdf ouverts (path + lien hypertexte)
J'ai bien trouvé pour un fichier Word ou Excel mais impossible pour un fichier pdf.

Par avance,

Merci pour votre aide,

MaTmI
 

matmi

XLDnaute Nouveau
Re : Lister les documents pdf ouverts

J'arrive pour le moment à lister le nom de tous les pdf ouverts.
Il me reste à trouver comment obtenir le path pour faire lien hypertexte

Code:
Declare PtrSafe Function cherche_fenetre Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Declare PtrSafe Function get_titre Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare PtrSafe Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Sub tous_les_processus()

Dim titre As String

Columns(1).ClearContents
lin = 0
poign = cherche_fenetre(0, 0)
Do While poign <> 0
titre = String(100, Chr$(0))
get_titre poign, titre, 100
'MsgBox (titre)
titre = Left$(titre, InStr(titre, Chr$(0)) - 1)
If titre <> "" Then
    If Right(titre, 4) = ".pdf" Then
        lin = lin + 1
        Cells(lin, 1).Value = titre
        'Cells(lin, 1).Value = Left(titre, InStr(titre, Chr$(0)) - 14)
    End If
End If
poign = GetWindow(poign, 2)
Loop
End Sub
 

Discussions similaires

Statistiques des forums

Discussions
312 492
Messages
2 088 936
Membres
103 987
dernier inscrit
Doctami