Active property

Microsoft Visio Developer Reference

Active property

See also       

Indicates whether the instance of Microsoft Visio represented by the Application object is the active application on the Microsoft Windows desktop—the application with the highlighted title bar.

Version added

4.1

Syntax

intRet = object.Active

intRet

Integer. False (0) if the application is not active; True (-1) if it is active.

object

Required. An expression that returns an Application object.

Remarks

The active application on the Windows desktop is distinct from the active Visio instance, which is returned by a call to the OLE GetActiveObject function (GetObject function in Microsoft Visual Basic). The GetObject function retrieves the instance of Visio that was most recently activated, which may or may not be the active application on the desktop at that moment. Of all instances of Visio that are currently running, only one is the active Visio instance.

For example, suppose you start one instance of Visio and one of another application, such as Microsoft Excel.

  • If the instance of Visio is the active application on your desktop, GetObject(, "visio.application") retrieves that instance and its Active property is True.
  • If you activate the instance of Microsoft Excel, GetObject(, "visio.application") retrieves the same instance of Visio, but its Active property is False.

If an Application object's Active property is True, you can assume that the corresponding instance of Visio is the active instance of Visio unless the InPlace property is also True. If an instance of Visio is activated for in-place editing in a container application, that instance may not necessarily report itself as the active instance of Visio.