Outlook 2021 - I see no window name and Roboscript can't find it either

Started by mjwillyone, January 15, 2024, 07:50:53 AM

Previous topic - Next topic

mjwillyone

Hello all!  I have loved Winbatch since I started using it over 20 years ago.  I am NOT a programmer, but have programmed some great routines that have worked for me.

I have installed Outlook 2021 on a new laptop and cannot find the window name to do a bit of quick SendKeysTo script writing. 

RoboScript can't recognize the window name either.

How can I 1) determine if the program is running (window open) and 2) write keystroke code to it?

Thank you so much!
Mike

td

The latest version of Outlook is a UWP (sometimes also referred to as a Windows Store App) application so it plays by a slightly different set of rules. Also, WinBatch has multiple ways to access an application. You can use the window name, window ID, or process ID. You can get an application's window's name from the window ID or process ID using several other WinBatch functions.

All that said the name of the main window for Outlook on my system is "Outlook".

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mjwillyone

Thank you.  The window ID or process ID ... is the functions you mention the use of RoboScript?

td

Roboscripter does not use the process ID functions. However, the window ID and process ID functions are part of WinBatch, and to a lesser extent, the Control Manager Extender uses window IDs. You can determine a program's existence using the AppExsit function and get the program's main window ID or Window title using the WinItemProcID function. The AppProcID function can be used to obtain the process ID of a running application.

Note that the AppExist and AppProcID functions require the module name. In the case of Outlook 2021, the calls would look something like the following

if AppExist("olk") then do something...

olkId = AppProcId("olk")

where "olk" is Outlook's somewhat unusual module name.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

The module name for Outlook could also be "Outlook". It depends on whether or not you are attempting to use the version of Outlook that is a part of an Office distribution or the version that is now a part of Windows 11.  In other words, having Office 2021 installed on a system does not guarantee that a user is launching the Office 2021 version of Outlook.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

mjwillyone