Task.Close Method

Word Developer Reference

Closes the specified task.

Syntax

expression.Close

expression   Required. A variable that represents a Task object.

Example

This example activates Microsoft Excel and then closes it.

Visual Basic for Applications
  For Each myTask In Tasks
    If InStr(myTask.Name, "Microsoft Excel") > 0 Then
        myTask.Activate
        myTask.Close
    End If
Next myTask

See Also