Sub Test() Dim n As Long n = ActiveDocument.DataFields.Count MsgBox "There are " & n & " data fields defined."End Sub