Jump to content

Outlook Windows: They're All the Same?


Recommended Posts

This has me stumped. I'm trying to detect if there's an Outlook Calendar window open and use this line in my script:

If WinExists("Calendar - Microsoft Outlook")

It looks as if any Outlook window satisfies that WinExists condition. I know they all have the same handle, but if they're named differently, shouldn't AutoIt be able to tell them apart?

Any help is appreciated.

Link to comment
Share on other sites

This has me stumped. I'm trying to detect if there's an Outlook Calendar window open and use this line in my script:

If WinExists("Calendar - Microsoft Outlook")

It looks as if any Outlook window satisfies that WinExists condition. I know they all have the same handle, but if they're named differently, shouldn't AutoIt be able to tell them apart?

Any help is appreciated.

Try using If WinActive()

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Try using If WinActive()

Thanks. That has two disadvantages: I have to run my script from the Calendar Window; if I run it from any other Outlook Window, again, AutoIt thinks that the title is "Calendar" even when it's "RE: Lurch" (for example).

There is something not right about the way Outlook windows report their window titles and how AutoIt reads those titles.

Link to comment
Share on other sites

Thanks. That has two disadvantages: I have to run my script from the Calendar Window; if I run it from any other Outlook Window, again, AutoIt thinks that the title is "Calendar" even when it's "RE: Lurch" (for example).

There is something not right about the way Outlook windows report their window titles and how AutoIt reads those titles.

I'm suspecting that the window you are looking for does actually exist when outlook is running. It's just hidden. It could well be just a child window with the state SW_HIDE set. Try running WinList() and WinGetState() against it and see what you can determine.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I'm suspecting that the window you are looking for does actually exist when outlook is running. It's just hidden. It could well be just a child window with the state SW_HIDE set. Try running WinList() and WinGetState() against it and see what you can determine.

You're right, there is a hidden window. It's quite bizarre, actually: when I make it visible, it doesn't contain anything useful, and when I manually close the window, all of Outlook shuts down! I'd better head over to whatever forum answers Outlook questions this isn't AutoIt, after all.

Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...