Tasks Collection Object
Word Developer Reference |
A collection of Task objects that represents all the tasks currently running on the system.
Remarks
Use the Tasks property to return the Tasks collection. The following example determines whether Microsoft Excel is running. If it is, this example switches to it and maximizes it; otherwise, the example starts it.
Visual Basic for Applications |
---|
|
Use Visual Basic's Shell function to run an executable program and add the program to the Tasks collection.
Use Tasks(Index), where Index is the application name or the index number, to return a single Task object. The following example opens and resizes the application window for the first visible task in the Tasks collection.
Visual Basic for Applications |
---|
|
The following example restores the Calculator application window if the application is in the Tasks collection.
Visual Basic for Applications |
---|
|
See Also