1
votes

VSTO: Outlook 2007 Add-In Project.

I have Sent an sampleEmail using a custom button in the Ribbon control. Now, How, can get the sampleEmail from Sent Items folder?

I tried by using the Entry ID property. but that was not helpful after the Email is sent.

The Conversation ID is null for a new Email.

Any other property, by which I can exactly read an Email that I have sent.

3
a Little more Information would be helpful - e.g. what do you want to do with the email afterwoods? Maybe it would be possible to already perform those actions in the item.send-Event?Max

3 Answers

0
votes

The Entry ID wont help coz, its not a Unique Id that exists for the mail... it changes whn moved from one folder to another...In your case what would help is to access the Sent items folder and access the item by Index n verify tht its the same that you sent by checking some other attributes of the mail like the Subject, Sender etc.

0
votes

This is what I did. As soon as the Email is sent, in the next line of code, I read the last sent mail and stored the Entry ID in a static class variable. We can Find the item through Entry ID in the Sent Items folder.

0
votes

You can set a named property on the item before sending it using MailItem.UserProperties or ailItem.PorpertyAccesor, then search for that property in the Sent Items folder (MAPIFolder.Items.Find).

UPDATE. The query for MAPIFolder.Items.Add would be

set item = MAPIFolder.Items.Find("@SQL=""http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/Spartan"" = 'test123' ")