CountDocumentVars()

Syntax

CountDocumentVars()

Remarks

Returns the number of document variables set with SetDocumentVar or SetDocumentVar() in the active document.

Example

This example resets each document variable in the active document to an empty string (""). If the document contains no variables, a message box is displayed.


numVars = CountDocumentVars()
If numVars > 0 Then
    For i = 1 To CountDocumentVars()
        name$ = GetDocumentVarName$(1)
        SetDocumentVar name$, ""
    Next
Else
    MsgBox "No document variables to reset."
End If

See Also

GetDocumentVar$(), GetDocumentVarName$(), SetDocumentVar