TaskPanes.Item property

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

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

TaskPane this[
	Object varIndex
] { get; }

Parameters

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

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];
Show: