Open mail via WindowsDesktopSearch

A

Andre Maas

Hello,

i try to change some properties in a mail which is opened from the
windows desktop search, but it don't work.

if i worked in outlook and try to open a mail i used the function:

Application.ActiveExplorer().Selection[1]

this works fine. i get the mail i clicked on.

But if i try to open an mail which i found with the windows desktop
search this code wouldn't work.

I think that the use of ActiveExplorer() is the fault.

Has someone a tip?

Thanx and regards
André
 
A

Andre Maas

Hi,

if i use the Application.ActiveInspector().CurrentItem an
nullpointerexception is thrown.

i also checked the ActiveInspector count which is 0!

Regards
Andre
 
K

Ken Slovak - [MVP - Outlook]

You can't count ActiveInspector, it's an object. You can count the
Outlook.Application.Inspectors collection.

Where are you trying to read that ActiveInspector.CurrentItem object? In
what event handler?

If this is from outside Outlook then you might need to use
Outlook.Application.Inspectors.Item(1) instead of ActiveInspector. See if
that works.
 
A

Andre Maas

I've tested 2 events.

1. Application.ItemLoad and
2. Application.ActiveExplorer().SelectionChange

it seems that the second event isn't the right one because of
'ActiveExplorer()'.

But all i tested i never get the Application.Inspectors.Item(1). :-(

Is there a special event i must listen to?

Regards
Andre
 
K

Ken Slovak - [MVP - Outlook]

If Outlook isn't running then ItemLoad won't fire and Explorers have nothing
to do with open items, Inspectors are associated with open items as I've
mentioned a number of times.

When a Simple MAPI Inspector is opened (from the file system or a Send To
action) you don't get any events, not even the
Application.Inspectors.NewInspector event, even if Outlook is already
running at the time. The only indication that a Simple MAPI Inspector has
been opened is that the Inspectors.Count property is incremented when that
Inspector is added to the Inspectors collection. The only access to that
Inspector is through the Inspectors collection. What I told you is the only
way.
 

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