bonjour Gaetan
j'espere que cet exemple poura t'aider à recuperer les informations sur les fichiers PDF du repertoire
( un lien hyerptexte est créé dans la premier colonne , pour ouvrir directement les documents )
Sub listeFichiersPdf()
'necessite d'activer la reference Microsoft Shell Controls and Automation
Dim objShell As Shell
Dim strFileName As FolderItem
Dim objFolder As Folder
Dim i As Integer
Dim Chemin As String
Chemin = "C:\Documents and Settings\michel\dossier\general\excel"
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(Chemin)
For Each strFileName In objFolder.Items
If Right(objFolder.GetDetailsOf(strFileName, 0), 4) = ".pdf" Then
i = i + 1
Cells(i, 1) = objFolder.GetDetailsOf(strFileName, 0)
Feuil1.Hyperlinks.Add Anchor:=Cells(i, 1), Address:=Chemin & "\" & _
objFolder.GetDetailsOf(strFileName, 0)
Cells(i, 2) = objFolder.GetDetailsOf(strFileName, 1) 'taille fichier
Cells(i, 3) = Format(objFolder.GetDetailsOf(strFileName, 4), "DD/MM/YYYY") 'date creation
Cells(i, 4) = objFolder.GetDetailsOf(strFileName, 9) 'auteur
'0 Name
'1 Size
'2 Type
'3 Date Modified
'4 Date Created
'5 Date Accessed
'6 Attributes
'7 Status
'8 Owner
'9 Author
'10 Title
'11 Subject
'12 Category
'13 Pages
'14 Comments
'15 Copyright
'16 Artist
'17 Album Title
'18 Year
'19 Track Number
'20 Genre
'21 Duration
'22 Bit Rate
'23 Protected
'24 Camera Model
'25 Date Picture Taken
'26 Dimensions
'27 Not used
'28 Not used
'29 Not used
'30 Company
'31 Description
'32 File Version
'33 Product Name
'34 Product Version
End If
Next strFileName
End Sub
par contre je ne comprends pas bien quand tu dis que les fichiers s'ouvrent puis se referment
bonne journée
MichelXld