Option Explicit
Sub PropsToTable()
Dim oRange As Word.Range
Dim oProp As DocumentProperty
Dim sTmp As String
sTmp = "Property Name" & vbTab & "Property Value"
On Error Resume Next
For Each oProp In ActiveDocument.BuiltInDocumentProperties
sTmp = sTmp & vbTab & oProp.Name & vbTab & oProp.Value
Next
Set oRange = ActiveDocument.Range(0, 0)
With oRange
.InsertAfter Text:=sTmp
.ConvertToTable Separator:=wdSeparateByTabs, _
NumColumns:=2, _
AutoFit:=True
End With
Set oRange = Nothing
End Sub
|