Document property

Microsoft Visio Developer Reference

Document property

See also       

Gets the Document object that is associated with an object.

Version added

2.0

Syntax

objRet = object.Document

objRet

The Document object that contains the object.

object

Required. An expression that returns an object in the Applies to list.

Remarks

The Document property of a docked stencil window returns a Document object for the stencil that is currently at the top of the window. If another stencil replaces the first in the top position, the first stencil's document is closed so the reference to it becomes invalid. For best results, assume that document references to docked stencils are not persistent.

If a Window object shows no documents are open, then no document is returned and no exception is raised. Your solution should check for Nothing returned after retrieving the Document property of a Window object.