HTMLDocument Property

Microsoft Office InfoPath

Show All Show All

HTMLDocument Property

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

expression.HTMLDocument

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

Security Level

2: 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.

Remarks

The HTMLDocument 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 HTMLDocument method, 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.

Example

In the following example, the HTMLDocument property of the HTMLTaskPane object is used to set a reference to the HTML document object of the custom task pane. 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).HTMLDocument;
objHTMLDoc.parentWindow.TaskPaneSwitchView();