TaskPanes.Item property

Office 2013 and later

Gets a reference to the specified the TaskPaneObject object from the collection.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

TaskPane this[
	Object varIndex
] { get; }


Type: System.Object

A numeric expression that specifies the type of task pane. Based on the XdTaskPaneType enumeration.

If the value provided for the varIndex argument does not match any existing member of the collection, an error occurs.

After you have set a reference to the TaskPaneObject object that the Item property returns, you can access any of its properties and methods.

Important noteImportant

This member can be accessed without restrictions.

Because the Item property is the default property of the TaskPanesCollection collection, it can be used as follows:

TaskPane taskPane = thisXDocument.View.Window.TaskPanes[4];