Outlook Application ActiveWindow() always return Explorer object

A

AtulSureka

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 
A

AtulSureka

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top