How to detect if New Message window is open?

M

michaaal

I want to do something like this...

If OpenNewMessageWindow="yes" then
msgbox ("The new message window is open")
Else
msgbox ("The new message window is not open")
End If

I know my code isn't right. Could someone lead me in the right direction?
Thanks.
 
S

Sue Mosher [MVP-Outlook]

The Application.Inspectors collection contains all the open item windows,
including any for new messages. You could loop through that collection,
examine each Inspector.CurrentObject object to see if it's a new message. In
a new message, the Sent property will be False.
 
Top