outlook. vba. the date of reply

the answer to the question "the exact date time on the "you replied to this message on [xxx]" describes the solution with the property PR_LAST_VERB_EXECUTION_TIME

but if that property is absent in the list of properties, can i find the date or the message-answer in the other way?

there is only property PR_LAST_VERB_EXECUTED in the window "get prop" of the program "outlookSpy".

thanks in advance

Sub Extracting()
Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myFolder, ssBox As Outlook.Folder
Dim sch As Outlook.Search
Dim rsts As Outlook.Results
Dim sDate, eDate, strS, strF, DatiRe As String
Dim i As Integer

Set myolApp = GetObject(, "Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set mySheet = xlApp.Worksheets("Ëèñò1")
sDate = Format(Date, "dd.mm.yyyy")
eDate = Format(Date, "dd.mm.yyyy")
i = 1
While i <= myNamespace.Folders.Count
 If myNamespace.Folders.Item(i).Name = "mmm@mail.ru" Then
   Set myFolder = myNamespace.GetFolderFromID(myNamespace.Folders.Item(i).EntryID, myNamespace.Folders.Item(i).StoreID)
   i = myNamespace.Folders.Count
 End If
 i = i + 1

blnSearchComp = False
Set ssBox = myFolder.Folders("Inbox")
strS = "'" & ssBox.FolderPath & "'"
strF = "urn:schemas:httpmail:datereceived >= '" & sDate & " 0:00' AND urn:schemas:httpmail:datereceived <= '" & eDate & " 23:59'"
Set sch = myolApp.AdvancedSearch(strS, strF, False, "aaa")
While blnSearchComp = False
Set ssBox = myFolder.Folders("Outbox")
Set rsts = sch.Results
For i = 1 To rsts.Count
    Debug.Print rsts.Item(i).SenderName
    DatiRe = GetDaTiAnswer(rsts.Item(i).ConversationIndex, rsts.Item(i).ConversationTopic, ssBox.FolderPath)
    Set NextRow = mySheet.Range("A" & mySheet.Rows.Count).End(-4162).Offset(1)
    NextRow.Resize(, 4).Value = Array(rsts.Item(i).SenderEmailAddress, rsts.Item(i).ReceivedTime, DatiRe, rsts.Item(i).Subject)
End Sub

Function GetDaTiAnswer(ByVal iConvIndex, iConvTopic, parP As String) As String
 Dim oApp As Outlook.Application
 Dim oSch As Outlook.Search
 Dim oRes As Outlook.Results
 Dim parC As String
 Dim j As Integer
 blnSearchComp = False
 Set oApp = GetObject(, "Outlook.Application")
 parC = "http://schemas.microsoft.com/mapi/proptag/0x0070001F = '" & iConvTopic & "'"
 Set oSch = oApp.AdvancedSearch("'" & parP & "'", parC, False, "aaa")
 While blnSearchComp = False
 Set oRes = oSch.Results
 For j = 1 To oRes.Count
    Debug.Print oRes.Item(j).SenderName
    If Left(oRes.Item(j).ConversationIndex, Len(oRes.Item(j).ConversationIndex) - 10) = iConvIndex Then
      GetDaTiAnswer = oRes.Item(j).SentOn
    End If
End Function


According to http://msdn.microsoft.com/en-us/library/office/aa172005(v=office.11).aspx you should be able to access the PR_CLIENT_SUBMIT_TIME which is the MailItem.SentOn property.

So if you find the item in the sent items, that's the property to look for.

Need Your Help

Using custom request and custom redirect with Contact Form 7

php wordpress

I have several sites that I want to link back to the main site which hosts the contact form (using contact form 7).