Outlook: new mail item, get editing time

bernie321

New member
Joined
Mar 31, 2006
Messages
1
Programming Experience
5-10
Hi

As part of an addin we need to either get or time the editing time of an email, from when it is created to when it is sent.

I have no idea how to do this, any help would be much appreciated.

Thanks
B
 
bernie321

This may give you a starting point



Sub EditingTime()
Dim NameSpace As NameSpace
Dim SentMail As MAPIFolder
Dim Item As Object​
Set NameSpace = GetNamespace("MAPI")​
Set SentMail = NameSpace.GetDefaultFolder(olFolderSentMail)​
For Each Item In SentMail.Items
TimeCreated = Format(Item.CreationTime, "dd/mm/yyyy-hh:nn:ss")​
SentTime = Format(Item.SentOn, "dd/mm/yyyy-hh:nn:ss")​
Duration = Format(Item.CreationTime - Item.SentOn, "hh:nn:ss")​

Debug.Print " Created Time:"; TimeCreated​
Debug.Print " Sent Time:"; SentTime​
Debug.Print " Duration:"; Duration
Next
Set NameSpace = Nothing
Set SentMail = Nothing


End Sub
 
Back
Top