Get Email's Information

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

Get Email's Information
 
tarz me




Posts: 7
Joined: 2007-03-28
Hi ,

I have created a Add-in button in Outlook 2003 V.11 using C# (.net 1.1) (Works fine).

I am tiring to capture emailís information (body, subject, email-address..etc)
-- I found how to get all items. But I want to get information depending on what email I select and than press the button.

for example:

GET All emails from Inbox folder:

NameSpace outlooksNS = applicationObject.GetNamespace("MAPI");
folder = outlooksNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
items= folder.Items;
for(int i=0; i<=items.Count;i++)
{
.........
}

Does anyone know how to get specific email information..

Thank you in advance..
Posted 28 Mar, 2007 15:20:27 Top
tarz me




Posts: 7
Joined: 2007-03-28
found it.. dont know how to delete this msg now..
Posted 28 Mar, 2007 15:51:27 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Hi Tarz.

There is no need to delete your post. You can also publish your code in this topic. Who knows, probably it will useful to somebody.
Posted 29 Mar, 2007 09:36:46 Top
tarz me




Posts: 7
Joined: 2007-03-28
OK . sure why not.
I found this code in one of the threads here..

MailItem mailObject=null;
Explorer explorer = applicationObject.ActiveExplorer();
Selection selObject = explorer.Selection;
object item = selObject[1];

mailObject = item as MailItem;
string subject = mailObject.Subject;
MessageBox.Show("subject: " + subject);
Posted 29 Mar, 2007 10:23:56 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Thanks.
Posted 29 Mar, 2007 10:33:30 Top