Hi,
I have the code below, how to modify that in column "H" add hyperlink to open email:
Thank you,
I have the code below, how to modify that in column "H" add hyperlink to open email:
VBA Code:
Sub ProcessFolder(olfdStart As Outlook.MAPIFolder, _
Subject As String, _
StartDate As Date, _
EndDate As Date)
Dim olObject As Object
Dim n As Long
n = 2
For Each olObject In olfdStart.Items
If TypeName(olObject) = "MailItem" Then
If Int(olObject.ReceivedTime) >= StartDate And Int(olObject.ReceivedTime) <= EndDate Then
If olObject.Subject Like "*" & Subject & "*" Then
Cells(n, 1).Value = olObject.Subject
If Not olObject.UnRead Then Cells(n, 2).Value = "Message is read" Else Cells(n, 2).Value = "Message is unread"
Cells(n, 3).Value = olObject.ReceivedTime
Cells(n, 4).Value = olObject.LastModificationTime
Cells(n, 5).Value = olObject.Body
Cells(n, 6).Value = olObject.SenderName
Cells(n, 7).Value = olObject.FlagRequest
n = n + 1
End If
End If
End If
Next
Set olObject = Nothing
End Sub
Thank you,