HTMLWindow Property

Microsoft Office InfoPath

Show All Show All

HTMLWindow Property

Returns a reference to an HTML window object of the Microsoft Office InfoPath 2003 custom task pane.

expression.HTMLWindow

expression    Required. An expression that returns a reference to the HTML window object.

Security Level

3: Can be accessed only by fully trusted forms.

Remarks

The HTMLWindow property of the HTMLTaskPane object is one of the properties inherited by the TaskPane object when the type of the task pane is 0, which means that it is the custom task pane.

Using the HTMLWindow property, you can call scripting functions contained in the HTML code of the task pane from the primary scripting file of a form, and you can also directly manipulate the HTML code of the task pane using any of the properties and methods that the HTML document object provides.

Note  The HTMLWindow property provides the same functionality as the HTMLDocument property, but it is only available when using fully trusted forms. If the form is not fully trusted, you can use the HTMLDocument property.

Example

In the following example, the HTMLWindow property of the HTMLTaskPane object is used to set a reference to the HTML window object of the custom task pane of a fully trusted form. Then the code calls the TaskPaneSwitchView custom function that is defined in the HTML code of the custom task pane.

    var objHTMLDoc;

objHTMLDoc = XDocument.View.Window.TaskPanes(0).HTMLWindow;
objHTMLDoc.parentWindow.TaskPaneSwitchView();