App Activatetitle[ wait

This function (which does not return a value) lets you activate an application that you started previously from within your VB code with the Shell() function. The first argument, title, specifies the title of the application (as it appears in the titlebar of the application's window). You can also use the ID of the application returned by the Shell() function. The wait argument is optional; it's a Boolean value that determines whether the calling application has the focus before activating another. If it's False (the default value), the specified application is immediately activated, even if the calling application does not have the focus. If it's True, your application must wait until it gets the focus before it can activate the external application. The AppActivate statement changes the focus to the named application or window but does not affect whether it is maximized or minimized.

If you're using the application's title to activate it, make sure you provide enough information to make it unique. Word's title is "Microsoft Word" followed by the name of the active document. If you specify only the string "Microsoft Word" and multiple instances of Word are running, you don't know which one will be activated by the AppActivate statement. It is best to use the ID of the application you started with the Shell() function.

0 0

Post a comment