I am using outlook 2010 and Access 2010. I click on a button in access that goes to the test Subroutine. I am trying to open a hyperlink that is in an email I get every day. I am getting an error 91 object not set. I have tried many different ways of using the email object with no success. I am hoping to get some assistance. My goal is to open the hyperlink in this email which goes to an excel file. After the excel file is open I would like to save it in a folder that exists called C:\DOR_Files\Daily_Net_Adds
The hyperlink is
The subject in the email is Northeast Daily Net Adds -April 2015
Any help is appreciated
Tom
The hyperlink is
The subject in the email is Northeast Daily Net Adds -April 2015
Any help is appreciated
Tom
Code:
Sub LaunchURL(itm As MailItem)
Dim bodyString As String
Dim bodyStringSplitLine
Dim bodyStringSplitWord
Dim splitLine
Dim splitWord
bodyString = itm.Body
bodyStringSplitLine = Split(bodyString, vbCrLf)
For Each splitLine In bodyStringSplitLine
bodyStringSplitWord = Split(splitLine, " ")
For Each splitWord In bodyStringSplitWord
If Left(splitWord, 7) = "[URL unfurl="true"]http://"[/URL] Then
Shell ("C:\Program Files\Internet Explorer\IEXPLORE.EXE" & " " & splitWord)
End If
Next
Next
Set itm = Nothing
End Sub
Public Sub test()
Dim currItem As MailItem
Set currItem = ActiveInspector.CurrentItem
LaunchURL currItem
End Sub