Show All

# XDocument Property (HTMLTaskPaneExternal Object)

A read-only property that returns a reference to the XDocument object associated with a custom task pane.

expression.XDocument

expression Required. An expression that returns a reference to the HTMLTaskPaneExternal object.

## Security Level

0: Can be accessed without restrictions.

## Remarks

The XDocument object returned by the XDocument property represents the form's underlying XML document that is associated with the custom task pane.

## Example

In the following example, the HTMLTaskPaneExternal object is used through the external property of the Dynamic HTML (DHTML) window object to set a reference to the XDocument object that is part of the InfoPath object model:

    var objXDoc;

    objXDoc  = window.external.XDocument;
    objXDoc.View.SwitchView("View2");

©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