Documents property example

The following example demonstrates how to use the Documents property to return the number of documents in the document collection object.

Private Sub DocumentsPropExample()

     Dim myDoc As Document

     Dim nodocs As Integer

     nodocs = Application.Documents.Count

     MsgBox "No. of documents = " & nodocs

End Sub