Determine if Outlook is invisible and opened from VBA or Mail Merge

Add-in Express™ Support Service
That's what is more important than anything else

Determine if Outlook is invisible and opened from VBA or Mail Merge
 
EnterpriseDev


Guest


I have an Outlook Add-in that listens to the ItemSend event and shows a dialog window. There is an issue when Outlook is opened silently from VBA or Mail Merge where the dialog window is indeed open but is not visible or clickable. It only shows if minimizing e.g. Word if using Mail Merge from there. It looks like setting ShowInTaskbar = true on the dialog window solves the issue for these cases. However, I only want to use ShowInTaskbar = true in these cases when Outlook is invisible.

Do you happen to know how to determine if Outlook is run in "invisible mode"?
I was thinking something in the line of receiving the active window and if it is null assume it is indeed in invisible mode. Ref last reply in https://stackoverflow.com/questions/41967734/test-if-outlook-is-running-in-background-or-visible.
Posted 23 Jul, 2018 00:23:35 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello,

Explorers.Count is zero in this scenario. This is also the case if Outlook isn't started and you use Send to | Mail Recipient from the Windows Explorer.


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jul, 2018 04:48:30 Top
EnterpriseDev


Guest


Thanks so much. This seems to work great.
Posted 23 Jul, 2018 08:00:18 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 23 Jul, 2018 10:22:50 Top