Outlook disconnected alert?

Started by MW4, December 18, 2023, 04:24:46 PM

Previous topic - Next topic

MW4

Hi everyone,
I was just wondering if someone could point me in a direction to fix an issue that I am having.

Over the years I have built many automated processes using a combination of Outlook VBA  and Winbatch.

In the last several months, I have experienced an issue where the outlook session loses connectivity and it can be days before it is noticed as it runs on a process server.

What I need is a way to be notified of the disconnection, best by email or SMS.


Does anyone have this same issue, or could point me in the right direction to a attempt a solution?

kdmoyers

Well, speaking most broadly, I can offer this:

To take action on the failure of thing A, you need some kind of
other thing B that runs very reliably and can sense when A fails.

In environments where there are several "A" type processes,
This is commonly done by having all of your A processes drop
a regular periodic signal, like perhaps a file update, or web socket
connection.  The fact that it keeps doing this thing proves it
is still healthy.

Then your B process scans the signals looking for one that is late.
Lateness indicates that your A process failed.  Then the B process
can send a message "Bad news: BILLING failed."

A commercial solution that I used to use is called Woodstone Servers
Alive, but I've also written similar stuff myself.
The mind is everything; What you think, you become.

stanl

Kirby's suggestion of a semaphore object/or file is on target. Probably need more clarification of an "outlook session".

MW4

"outlook session" refers to outlook running and then losing the internet connection, or microsoft having a pause. Then a message pops up and the session remains disconnected, until you manually re-connect.

stanl

Quote from: MW4 on December 23, 2023, 11:26:18 PM
"outlook session" refers to outlook running and then losing the internet connection, or microsoft having a pause. Then a message pops up and the session remains disconnected, until you manually re-connect.


Thanks, probably sounded like a dumb question; maybe it was. So the Outlook Process ID is still active, but the mailbox has been disconnected from Internet.

MW4

Yes, and you'd think it would auto-connect but no.
It just sits there disconnected.

cssyphus

Is there any visible error message or abnormality visible on the screen when such a disconnect occurs?

I ask because I've built a few solutions where I first capture an area of the screen to use as a control example and then, within a while loop, re-capture that portion of the screen and compare it to the baseline screengrab using the fc.exe dos command. When the two screengrabs are not identical, a subroutine can be fired. Works like a charm. Happy to share more / code example if that might help.

Note that this same method can be used to compare a list of items (e.g. emails in inbox). If the top item remains unchanged for a period of time, fire off the subroutine.