Window.Activate method

Office 2013 and later

Activates (gives focus to) the window that is represented by the Window object.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

public abstract void Activate()

The Activate method can be used when more than one InfoPath form is open to give focus to the window represented by the referenced Window object.

The Activate method can be used only with the editing window types; if used with a designing window type, it will raise an exception.

To determine whether a window is the active window, use the Active property.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

In the following example, the Activate method of the Window class is used to give focus to the third window in the collection of open windows.