Window.Activate Method (Visio)

Activates a window.

Syntax

expression. Activate

expression An expression that returns a Window object.

Return value

Nothing

Remarks

Microsoft Visio can have more than one window open at a time; however, only one window is active. Activating a window can change the objects returned by the ActiveWindow , ActivePage , and ActiveDocument properties.

If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this method maps to the following types:

  • Microsoft.Office.Interop.Visio.IVWindow.Activate()

Example

The following macro creates two windows and then shows how to activate one of the windows.

Public Sub Activate_Example() 
 
    Dim vsoDocument As Visio.Document  
    Dim vsoWindow As Visio.Window  
      
    'Create two new windows by adding documents. 
    Set vsoDocument = Documents.Add("")  
    Set vsoWindow = ActiveWindow  
    Set vsoDocument = Documents.Add("")  
     
    'Use the Activate method to make the first 
    'window created the active window. 
    vsoWindow.Activate 
 
End Sub