AppClose

Syntax

AppClose [WindowName$]

Remarks

Closes the specified application.

Argument

Explanation

WindowName$

In Windows, a string that matches the beginning of an application window name, as it appears in the title bar or Task List. If omitted, Word is assumed. On the Macintosh, WindowName$ is either the application name or the signature returned by MacID$(). For more information on WindowName$, see AppActivate.


Example

This example closes Microsoft Excel if it is running:


If AppIsRunning("Microsoft Excel") Then
    AppClose "Microsoft Excel"
End If

On the Macintosh, you can rewrite the previous example as follows, using MacID$() to specify the Microsoft Excel signature. This ensures the example will work even if the user has changed the filename for Microsoft Excel.


If AppIsRunning(MacID$("XCEL")) Then
    AppClose MacID$("XCEL")
End If

See Also

AppActivate, AppIsRunning(), FileExit, FileQuit, MacID$(), Shell