ADD HYPERLINK TO SPREADSHEET TO OPEN EMIAL

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
786
Office Version
  1. 365
Hi,

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,
 

Attachments

  • GETEMAIL.png
    GETEMAIL.png
    10.6 KB · Views: 4

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,810
Messages
6,181,079
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top