Jeg har et lille VB program som konvertere word properties ud i txt filer og det fungere ved at jeg vælger filen og trykker metadata udlæsning og så køre det ... men jeg skal kunne vælge en mappe også trykkes kør også den så selv ordner alle *.doc filer men hordan ...
Knappens kode :
Private Sub Command2_Click()
Dim prop, antalBrugerDef, f
Rem ENTEN:
On Error GoTo A:
Dim appWord As Word.Application
Dim wrdDoc As Word.Document
Dim strFileName As String
strFileName = Dir1.Path + "\\" + File1.FileName
strFileName = Trim(Replace(strFileName, "\\\\", "\\", 1, -1, vbBinaryCompare))
Set appWord = New Word.Application
Set wrdDoc = appWord.Documents.Open(strFileName)
MsgBox (strFileName)
Open Dir1.Path & "\\" + File1.FileName + ".txt" For Output As #2
antalBrugerDef = ActiveDocument.CustomDocumentProperties.Count
For f = 1 To antalBrugerDef
With ActiveDocument.CustomDocumentProperties(f)
MsgBox (.Name + " " + .Value)
Print #2, (.Name + " : " + .Value)
End With
Next f
Rem Eller:
Rem Vis brugerdef.
For Each prop In ActiveDocument.CustomDocumentProperties
navn = prop.Name
værdi = prop.Value
Next prop
For Each prop In ActiveDocument.BuiltInDocumentProperties
MsgBox (prop.Name + " : " + prop.Value)
Print #2, prop.Name + " : " + prop.Value
Next prop
A:
Print #2, ""
Print #2, " ----> End of File <---- "
Print #2, Dir1.Path + File1.FileName
Close #2
Set f = Nothing
Set prob = Nothing
Set antalBrugerDef = Nothing
'Word.Documents.Save
'wrdDoc.Close
'appWord.Quit
Set appWord = Nothing
Set wrdDoc = Nothing
End Sub