Share via


6.1.2.8.2.1 AppActivate

Function Declaration

 Sub AppActivate(Title As Variant, Optional Wait As Variant) 

Parameter

Description

Title

String specifying the title in the title bar of the application window to activate. The task ID returned by the Shell function can be used in place of title to activate an application.

Wait

Boolean value specifying whether the calling application has the focus before activating another. If False (default), the specified application is immediately activated, even if the calling application does not have the focus. If True, the calling application waits until it has the focus, then activates the specified application.

Runtime Semantics.

§ Activates an application window.

§ The AppActivate statement changes the focus to the named application or window but does not affect whether it is maximized or minimized. Focus moves from the activated application window when the user takes some action to change the focus or close the window. Use the Shell function to start an application and set the window style.

§ In determining which application to activate, Title is compared to the title string of each running application. If there is no exact match, any application whose title string begins with Title is activated. If there is more than one instance of the application named by Title, the window that is activated is implementation-defined.