Event before displaying the mail?

S

sba

Hi there

Is there a hook in Outlook that is called before displaying a mail in
the preview window?
It is about proper displaying of mail stubs in Outlook. A mail stub is
a mail that contains an IFrame that points to a place where the (real)
archived mail can be read.

I'd like to achieve two things with it:
1) Reading and altering (but not saving) the mail before displaying it.
In this case, my intention is to alter the host name part in the IFrame
URL.
or
2) Reading the mail, updating an attribute and saving it. An OnSyncSave
handler on the Exchange server site will catch this and replace the
mail stub with the (real) mail from the archive. Outlook then will load
that mail again and display. The Exchange site is not a problem for me.
I mastered that by now.

Are both or one of these tasks possible? Which one? How? Mind you, that
I'm a novice in programming Outlook applications.

Any hints appreciated.
Cheers,
Stephan Bachofen
 
K

Ken Slovak - [MVP - Outlook]

Explorer.SelectionChange is probably your best bet. You'd have to read the
Selection collection to see what was selected. There is no event for when an
item is being displayed in the preview pane other than Item.Read, but to get
to Item you'd need to find it from the selection.
 
S

sba

Hi Ken

Thanks for your tip. I did it with the SelectionChange event. I kind of
works: The problem is , that Outlook keeps the old mail cached and
therefore keeps displaying the old (stubbed) mail. We'll see how I can
solve that.

Cheers,
Stephan
 
K

Ken Slovak - [MVP - Outlook]

You would have to release all references to the original and then get new
objects from the original EntryID and NameSpace.GetItemFromID. You might
have to redisplay, which is a problem because it will cause screen flicker.
 

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