# ActiveWindow Property

A read-only property that returns a reference to a Window object that represents the currently active window. The type of window returned is based on the XdWindowType enumeration.

expression.ActiveWindow

expression Required. An expression that returns the Application object.

## Security Level

0: Can be accessed without restrictions.

## 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.

## Example

In the following example from the Meeting Agenda sample form, the ActiveWindow property is used to gain access to the MailEnvelope property of the Window object that returns a MailEnvelope object.

    var oEnvelope = Application.ActiveWindow.MailEnvelope;

    oEnvelope.Subject = getNode("/mtg:meetingAgenda/mtg:subject").text;
    oEnvelope.To = rgRecipients.join("; ");
    oEnvelope.Visible = true;

©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp