Distinguish between an send and received mail item

Add-in Express™ Support Service
That's what is more important than anything else

Distinguish between an send and received mail item
 
Erik Søndergaard




Posts: 2
Joined: 2005-05-25
Hi.

I created two buttons in the Inspector, one for items received and one for items sent (So I can dertermine if the e-mail address is a received address or sent address)

Then I'll make the correct button visible in a sub that Handles MyBase.OlInspectorActivate

I can't use the item.sent property, because it determines if its at new item that is not sent. All received items is also marked as "sent".

Thanks

Bent
IntraNote a/s
Denmark
Posted 29 Jun, 2005 08:53:56 Top
Matt Driver


Matt


Posts: 152
Joined: 2004-08-17
Hi

My idea would be to test the item.RecievedByName which would be populated if you have recieved it and null if it was sent out by yourself.

This is only true for your mailbox though if you are working with exchange public folders it is different.

There maybe a better way of doing this though.

Matt
Posted 29 Jun, 2005 09:23:29 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Erik.

I am afraid there is no universal solution for this. The most simple way to work out this issue is to get the default folder name for "sent" items ( Outlook._NameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail) ) and extract the full name for this folder. Then you can use this full folder name to determine (in the InspectorActivate event handler) if your current inspector has been opened from the "Sent Items" folder (or subfolder) or not.
Posted 29 Jun, 2005 17:05:34 Top
Erik Søndergaard




Posts: 2
Joined: 2005-05-25
Sergey,

thanks, but I can't figure out to use Outlook._NameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail)

I can dot me to Outlook._Namespace, but then there is no methods at all. And how do I get the folder that opened the inspector?

Thanks a lot :-)
Posted 30 Jun, 2005 06:32:45 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Erik.

I will send you an example soon.
Posted 30 Jun, 2005 06:44:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Erik.

You can download an example here:
http://www.add-in-express.com/projects/olsentmail.zip
Posted 01 Jul, 2005 07:05:33 Top