Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.