No entryid on Itemsend Event

D

djtotofr

Hi,
i'm developping an outlook addin who log all email send.
There is the code

Private Sub goOutlook_ItemSend(ByVal Item As Object, Cancel As
Boolean)
If Item.Class = 43 Then
Item.Save
writetmp Item.EntryID + "$" + Item.Parent.StoreID
End If
End sub

If i remove Item.save method, Item.EntryID is empty, if i use
item.save method, entryid is not null, but outlook change is value
after itemsend method. thats why what i log is wrong.

There is a solution to get right entryid on a sent item ?
Thanks
 
K

Ken Slovak - [MVP - Outlook]

Until the item is saved or after it's sent it has no EntryID value. That's
why Save() would be needed.

However, there is no guarantee that an EntryID will remain constant when an
item is moved within the store. That depends on the store provider.

With the PST store provider EntryID's remain the same as long as the item is
in the same store, even when it's deleted and in Deleted Items. With an
Exchange store provider the EntryID changes when an item is moved from one
folder to another.

You will need to trap the ItemAdd() event of the Items collection in the
Sent Items folder. When that event fires you can then get the EntryID. That
will cover all cases except where the item is set to not be saved after
sending or to be saved with the item being replied/forwarded.
 
A

Ashok

Hi Ken,

I have the same problem. My scenario is only valid when a user forwards an
item either from the inbox or from some other folder. I trap the ItemAdd()
event in the sent items folder, is there any way I can find out the which
item or items were forwarded in the parent folder? My requirement is I need
move the items from the sent items folder and also remove the original emails
from the parent folders.

Thanks for all the help
Ashok
 
K

Ken Slovak - [MVP - Outlook]

Look at ConversationIndex and ConversationTopic. Those will let you link the
item in Sent Items to the original item. All items in a thread have the same
ConversationTopic value. For each new item in the thread the
ConversationIndex has a new date/time structure value added to it. So each
new item in the thread has ConversationIndex just a bit longer than the
previous item.
 

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