I am trying to capture outlook mail response time in this below method, i get received time and mail sender name but i have one issue is if i select other mail like other than open current mail item parent mail, it capture selected mail information.
I want to current open mail item received time and sender name anyone help me to get that data from current item outlook header stamp like
From: Sent: To: Subject:
Thank you for your valuable timing and helping.
Set objItems = ActiveExplorer.Selection.Item(1)
RecievedTime = objItems.ReceivedTime
Set objItem = objOutlook.ActiveInspector.CurrentItem
Dim objPrope As Outlook.UserProperty
Set UserPrope = objItem.UserProperties.Find("RT")
If Not UserPrope Is Nothing Then
strCurrent = objItem.UserProperties("RT").Value
End If
Set objPrope = objItem.UserProperties.Add("RT", olDateTime, True)
objPrope.Value = Date_String
Err.Clear
Dim Sen As String
Sen = objItems.Sender
Set objItem = objOutlook.ActiveInspector.CurrentItem
Set UserPropr = objItem.UserProperties.Find("RN")
If Not UserPropr Is Nothing Then
strCurrent = objItem.UserProperties("RN").Value
End If
Set objPropr = objItem.UserProperties.Add("RN", olText, True)
objPropr.Value = Sen
Err.Clear
Set objItem = objOutlook.ActiveInspector.CurrentItem
objItem.Save
Bookmarks