Activate Method
Applies To
Application object, Document object, InlineShape object, OLEFormat object, Pane object, Shape object, ShapeRange collection object, Task object, Window object.
Description
Activates the specified object.
Syntax 1
expression.Activate(Wait)
Syntax 2
expression.Activate
expression Required. An expression that returns a Task object (Syntax 1) or another object in the Applies To list (Syntax 2).
Wait Optional Boolean. Task object only. True to immediately activate the task, even if Word isn't active. False to not activate the task until the user has activated Word.
See Also
ActivateAs method, Active property, ActiveDocument property, ActivePane property, ActivePrinter property, ActiveWindow property, Arrange method, Select method, SendWindowMessage method, WindowState property.
Example
This example activates the document named "Sales.doc."
Documents("Sales.doc").Activate
This example activates the next window in the Windows collection.
ActiveWindow.Next.Activate
This example activates the Notepad application if Notepad is in the Tasks collection.
For Each myTask In Tasks
If InStr(myTask.Name, "Notepad") > 0 Then
myTask.Activate
myTask.WindowState = wdWindowStateNormal
End If
Next myTask
This example splits the active window and then activates the first pane.
With ActiveWindow
.SplitVertical = 50
.Panes(1).Activate
End With