_Application2.ActiveWindow Property

Definition

Gets a reference to a WindowObject object that represents the currently active window.

public:
 property Microsoft::Office::Interop::InfoPath::SemiTrust::WindowObject ^ ActiveWindow { Microsoft::Office::Interop::InfoPath::SemiTrust::WindowObject ^ get(); };
public Microsoft.Office.Interop.InfoPath.SemiTrust.WindowObject ActiveWindow { get; }
member this.ActiveWindow : Microsoft.Office.Interop.InfoPath.SemiTrust.WindowObject
Public ReadOnly Property ActiveWindow As WindowObject

Property Value

Implements

Examples

In the following example, the ActiveWindow property is used to gain access to the MailEnvelope property of the WindowObject object that returns a MailEnvelopeObject object.

MailEnvelope email = thisApplication.<span class="label">ActiveWindow</span>.MailEnvelope;
email.Subject = getNode(@"/mtg:meetingAgenda/mtg:subject").text;
email.To = aliases + "; ";
email.Visible = true;

In the following example, the ActiveWindow property is used to gain access to the MailEnvelope property of the WindowObject object that returns a MailEnvelopeObject object.

MailEnvelope email = thisApplication.<span class="label">ActiveWindow</span>.MailEnvelope;
email.Subject = getNode(@"/mtg:meetingAgenda/mtg:subject").text;
email.To = aliases + "; ";
email.Visible = true;

Remarks

Using the ActiveWindow property, you can gain immediate access to the window that is currently being viewed by the user, and then use the properties and methods of the Window object that it returns.

Important: This member can be accessed without restrictions.

Applies to