Outlook Application ActiveWindow() always return Explorer object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am using Outlook Application ActiveWindow() API to get the topmost window
of Outlook. It should return either Explorer or Inspector object.

I have two Outlook windows
1. Outlook Application
2. NewMail Item inspector window

NewMail inspector window is activated (as I am writing writing mail). Now if
I am using OutlookSPY to get the ActiveWindow it returns the object of
Explorer.
It should return Inspector object of NewMailInspector window.

I have tried this from C# program also. There also I found that ActiveWindow
always returns Explorer objects.

Any help will be appreciated.

Atul Sureka
 
It works here. Try this in the immediate window of the Outlook VBA project:

? Application.ActiveWindow.Caption

When you have an item open and active. I haven't tried this using C#, but it
works just fine in VBA code.
 
Thanks for the reply.

But it is not working on my system.

On my machine I have two Outlook windows - one is main Outlook explorer and
other is NewMail Inspector. NewMail Inspector is active and it is over the
Outlook Explorer window.

With using Outlook SPY - I have clicked in CurrentItem in the NewMail
Inspector window - > Application -> call ActiveWindow() function -> It return
the Outlook Explorer object not the NewMail Inspector window.

I am not familiar with VBA so I have tested this using C# Outlook Addin.
Can you verify this on your system with Outlook SPY.

Atul Sureka
 
If I open a new mail Inspector and select CurrentItem in OutlookSpy, then go
to the Script tab and enter the following script line:

debug.print application.activewindow.caption

and then click on Run I get the caption of the Inspector window.
 
Back
Top