Class TaskPane (Word VBA)

The class TaskPane represents a single task pane available to Microsoft Word, which contains common tasks that users perform. The TaskPane object is a member of the TaskPanes collection.

Set

To use a TaskPane class variable it first needs to be instantiated, for example

Dim tpe as TaskPane
Set tpe = Application.TaskPanes(Index:=1)

The following procedures can be used to set variables of type TaskPane: TaskPanes.Item and Application.TaskPanes

For Each

Here is an example of processing the TaskPane items in a collection.

Dim tpe As TaskPane
For Each tpe In Application.TaskPanes
	
Next tpe

Parent

Returns an object that represents the parent object of the specified TaskPane object.

Dim objParent As Object
Set objParent = Application.TaskPanes(1).Parent

Visible

True if the specified object is visible.

For any object, some methods and properties may be unavailable if the Visible property is False.

Application.TaskPanes(1).Visible = True

TaskPanes.Count

Returns a Long that represents the number of task panes in the collection.

Dim lngCount As Long
lngCount = Application.TaskPanes.Count

TaskPanes.Item

Returns the specified task pane as a TaskPane object.

Syntax : expression.Item (Index)

Index: The specified task pane.

Dim tpe As TaskPane
Set tpe = Application.TaskPanes(Index:=1)

TaskPanes.Parent

Returns an object that represents the parent object of the specified TaskPanes object.

Dim objParent As Object
Set objParent = Application.TaskPanes.Parent