PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Re: get a sent mail ID

Reply

Re: get a sent mail ID

 
Thread Tools Rate Thread
Old 20-12-2006, 03:23 PM   #1
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: get a sent mail ID


That's about the only way if you're using CDO, which has no events. If you
also are using Outlook object model code just handle the ItemAdd event on
the Items collection of the Sent Items folder.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Xiao" <Xiao@discussions.microsoft.com> wrote in message
news:572E6874-5B3F-41F7-BCDA-88797F16B9A4@microsoft.com...
> Hi, I'm wondering how i could get the get the ID of a message that i've
> just
> sent.
> I'm using CDO, and after sending the message with MAPI.Message.Send all
> the
> message references are cleared. I know that the message it's copy in the
> sent
> mail box after sending, and i could find accessing in this folder but this
> it's a long way.
> Please,if you know a better way, please help me.
>
> Thanks.


  Reply With Quote
Old 20-12-2006, 06:23 PM   #2
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: get a sent mail ID

PR_RECORD_KEY can be used although it's not an exact match for the EntryID.
I believe the first 20 bytes represent the short term EntryID of the item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Xiao" <Xiao@discussions.microsoft.com> wrote in message
news:FC08E954-57F7-485E-BCFC-39DBDFB9602B@microsoft.com...
> thanks ken,
> Only one thing more, do you know if there is any Id or reference that
> connect the sent mail with the original one


  Reply With Quote
Old 20-12-2006, 09:00 PM   #3
Ken Slovak - [MVP - Outlook]
Guest
 
Posts: n/a
Default Re: get a sent mail ID

You can't change how Outlook does sending. However, you should be able to
trap ItemAdd on Sent Items with no problems, I do that all the time. The
item won't be added there until the item is actually sent out of course. An
event handler lets you not worry about when something is added, it fires
when the item is added no matter when.

You will need an object variable that handles events for that folder that
will remain in scope throughout the life of your application. If using .NET
code you have to avoid the garbage collector removing your folder object,
items collection and event handler.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Xiao" <Xiao@discussions.microsoft.com> wrote in message
news:F76873E4-4008-4232-A161-8DEA9DF9B873@microsoft.com...
> Thanks again ken,
> I've been also try to access to the setn item folder, but i think that the
> send process is asyncronous and it takes longer to create the new mail in
> the
> sent mail than i access to the fodler and try to find the recent one. Can
> i
> do the sending process syncronous?
>
> Thanks again for your help


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off