BuiltInDocumentProperties Property Example

This example inserts a list of built-in properties at the end of the active document.

Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseEnd
For Each prop In ActiveDocument.BuiltInDocumentProperties
    With myRange
        .InsertParagraphAfter
        .InsertAfter prop.Name & "= "
        On Error Resume Next
        .InsertAfter prop.Value
    End With
Next

This example displays the number of words in the active document.

wrds = ActiveDocument.BuiltInDocumentProperties(wdPropertyWords)
MsgBox "This document contains " & wrds & " words."