I need to log certain information regarding a message I'm sending from within Access (using Redemption). So I tried to hook into the sentfolder.itemadd event, but I am not able to reliably capture that event (I'm sending the message and immediately try to get its entryid, but if the message has some large attachments it doesn't make it into the sent folder fast enough).
Any suggestions?
Thanks to all!
VB Code:
Option Compare Database Option Explicit Dim WithEvents ObjOutlook As Outlook.Application, myNameSpace As Object Dim WithEvents objInspectors As Outlook.Inspectors Dim WithEvents objOpenInspector As Outlook.Inspector Dim WithEvents objMailItem As Outlook.MailItem Dim WithEvents colSentItems As Items Dim sMailItem As Redemption.SafeMailItem, boSent As Boolean Dim sInspector As Redemption.SafeInspector Public Sub Class_Initialize() boSent = False Set ObjOutlook = CreateObject("Outlook.Application", "localhost") Set objInspectors = ObjOutlook.Inspectors ......................................................................................... Private Sub colSentItems_ItemAdd(ByVal Item As Object) Dim strEntryID As String, sItem As Redemption.SafeMailItem If Item.Class = olMail Then Item.Save Set sItem = CreateObject("Redemption.SafeMailItem") sItem.Item = Item strEntryID = sItem.EntryID vcLOG_SENT_EMAIL (strEntryID) End If




Reply With Quote