AW: Dateien eines Verzeichnis suchen und auflisten
10.10.2003 11:23:01
ChrisL
Hi Rocco
Kann leider keine Zip Dateien öffnen und mit VBA Programmierung in Word kenne ich mich auch nicht aus, aber versuchs mal hiermit...
Sub WordListe()
Dim sFile As String, sPath As String, zeilennr As Long
Dim FSObjekt As Object, FObjekt As Object
Dim WordApp As Object, WordDoc As Object
Set WordApp = CreateObject("Word.Application")
On Error Resume Next
Application.ScreenUpdating = False
Set FSObjekt = CreateObject("Scripting.FileSystemObject")
sPath = "C:\PFAD"
If Right(sPath, 1) <> "\" Then sPath = sPath & "\"
sFile = Dir(sPath)
Do While sFile <> ""
If Right(sFile, 3) = "doc" Then
zeilennr = Range("A65536").End(xlUp).Row + 1
Cells(zeilennr, 1) = sFile
Set FObjekt = FSObjekt.GetFile(sPath & sFile)
Cells(zeilennr, 2) = FObjekt.DateLastModified
Cells(zeilennr, 3) = FObjekt.Size
WordApp.Application.Documents.Open sPath & sFile
Cells(zeilennr, 4) = WordApp.ActiveDocument.BuiltinDocumentProperties(3).Value
sFile = Dir()
End If
Loop
Set WordApp = Nothing
Application.ScreenUpdating = False
End Sub
Die Performance ist allerdings schlecht.
Gruss
Chris