Window2.TaskPanes property

Gets a reference to the TaskPanesCollection collection that is associated with the WindowObject object.

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

Syntax

'Declaration
ReadOnly Property TaskPanes As TaskPanesCollection
    Get
'Usage
Dim instance As Window2
Dim value As TaskPanesCollection

value = instance.TaskPanes
TaskPanesCollection TaskPanes { get; }

Property value

Type: Microsoft.Office.Interop.InfoPath.TaskPanesCollection

Implements

Window.TaskPanes

Remarks

The TaskPanesCollection collection can be used only with the editing window types; if used with a designing window type, it will return an error.

Examples

In the following example, the TaskPanes property of the WindowObject object is used to set a reference to the TaskPanesCollection collection:

TaskPanes taskPanes; 
taskPanes = thisXDocument.View.Window.TaskPanes;

In the following example, the Item property of the TaskPanesCollection collection is used to set a reference to a specified TaskPaneObject object. Then the code uses the Visible property of the TaskPaneObject object to make the task pane visible.

TaskPane taskPane;

// Show the built-in Help task pane.      
taskPane = thisXDocument.View.Window.TaskPanes[4];
taskPane.Visible = true;

Note

The Item property argument is the type of task pane to return, based on the TaskPaneType property of the TaskPaneObject object, not the position of the TaskPaneObject object in the TaskPanesCollection collection.

See also

Reference

Window2 interface

Window2 members

TaskPanes overload

Microsoft.Office.Interop.InfoPath namespace