Documents Property [Visio 2003 SDK Documentation]
Returns the Documents collection for a Microsoft Office Visio instance.
objsRet = object**.Documents**
objsRet The Documents collection of the Application object.
object Required. An expression that returns the Application object that owns the collection.
Version added
2.0
Remarks
You can iterate through a Documents collection by using the Count property to retrieve the number of documents in the collection. You can use the Item property to retrieve individual elements from a collection.
Example
The following Microsoft Visual Basic for Applications (VBA) macro shows how to iterate through a Documents collection and retrieve the name of an individual document. It displays the names of all the open Microsoft Visio documents in the Immediate window.
Public Sub Documents_Example()
Dim intCounter As Integer
Dim vsoDocument As Visio.Document
For intCounter = 1 To Documents.Count
'Get the next open document.
Set vsoDocument = Documents.Item(intCounter)
'Print its name in the Immediate window.
Debug.Print vsoDocument.Name
Next intCounter
End Sub
Applies to | <Global> object | Application object | InvisibleApp object
See Also | Count property | Documents collection | Item property