View Single Post
  #3  
Old April 21st 08, 03:04 PM posted to microsoft.public.outlook.program_addins
Marcin
external usenet poster
 
Posts: 9
Default Access to MailItem properties before opening new inspector ?

Ken,

when replying or forwarding an email, I am trying to get original sender
amongst other (also some from Item.Properties). However, the sender is null,
which is probably due to the fact, that the reply is de facto a new email
(new MailItem object). What I need , is access to the original email (that I
am replying to or forwarding), so that I could read some stuff from it. As
already said - I can get it from SelectionChange,Read or ItemLoad events, but
only when reading new item (new - that does not exist in the Outlook cache
yet).
To make it short - when executing action like reply or forward on MailItem,
I need to access the original message.

Kind regards

marcin

"Ken Slovak - [MVP - Outlook]" wrote:

Properties in an item are not lost when you open that item in an Inspector,
why would you say that?

Are you trying to get the properties in the NewInspector event handler? Wait
until the first Activate event for that Inspector, when the object for
Inspector.CurrentItem isn't a weak object reference but is fully filled in.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Marcin" wrote in message
...
Hi,

when opening MailItem in a new inspector, certain properties are lost
(SenderEmailAddress for example). I can access those properties before,
in
SelectionChange, ItemLoad or Read events, however, that works fine for
items
that have not been loaded into memory / cached yet.
If the item had been however read, it is somehow simply loaded from
cache/memory, without triggering those events. Any idea on accessing this
particular cached object properties before opening new inspector or
forcing
flushing the cache to cause re-reading ?



Ads