_Application2.ActiveWindow Property (Microsoft.Office.Interop.InfoPath.SemiTrust)

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

This property is not CLS-compliant.  

Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)

WindowObject ActiveWindow { get; }

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.

ImportantImportant:

This member can be accessed without restrictions.

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.ActiveWindow.MailEnvelope;
email.Subject = getNode(@"/mtg:meetingAgenda/mtg:subject").text;
email.To = aliases + "; ";
email.Visible = true;

Community Additions

ADD
Show: