Partager via


Task.Activate Method (Word)

Activates the Task object.

Syntax

expression .Activate(Wait)

expression Required. A variable that represents a Task object.

Parameters

Name

Required/Optional

Data Type

Description

Wait

Optional

Variant

True to wait until the user has activated Word before activating the task. False to immediately activate the task, even if Word isn't active.

Example

This example activates the Notepad application if Notepad is in the Tasks collection.

Sub ActivateNotePad() 
 Dim Task1 'Notepad must be open and in the Task List. 
 
 For Each Task1 In Tasks 
 If InStr(Task1.Name, "Notepad") > 0 Then 
 Task1.Activate 
 Task1.WindowState = wdWindowStateNormal 
 End If 
 Next Task1 
End Sub

See Also

Concepts

Task Object Members

Task Object