P
PaulW
Sub mail_hyperlink()
Dim objoutlook As Object
Dim objolns As Object
Dim objrecipient As Object
filll = "file://S:\Call Stats Report\" & ActiveWorkbook.Name
namm = ActiveWorkbook.Name
mess = "<a href=“""" & filll & """â€>" & namm & "</a>"
Set objoutlook = CreateObject("OUTLOOK.APPLICATION")
Set objolns = objoutlook.getnamespace("MAPI")
objolns.logon
With objoutlook.CreateItem(olMailItem)
.To = "paulwadsworth@XXX"
.Subject = "Daily Call Stats"
.HTMLBody = "Please find attached a hyperlink to the calls stats for
yesterday. <br>" & mess _
& "<br><br>Regards<br>Paul Wadsworth."
.Save
.Send
End With
objolns.logoff
Set objoutlook = Nothing
Set objolns = Nothing
Set objrecipient = Nothing
End Sub
That code is Exactly as I have the email, the only thing changed is my email
address. I haven't left anything out.
When I run the macro the email sends fine, but when trying to open the
hyperlink I get a "Locate Link Browser" window, and under "Types of File" I
can only select "Executable File".
I've tried without "file://" i've also tried various number of " on the
"mess =" line.
Someone I know sent me a file to mail a hyper link and the code was totally
different:
Set olApp = New Outlook.Application
Instead, but still the same error occurs.
At the end of the day, i'm trying to stop sending files on email, and send
hyperlinks instead, so that people's emails are filled up with stuff.
Can anyone help me out?
Dim objoutlook As Object
Dim objolns As Object
Dim objrecipient As Object
filll = "file://S:\Call Stats Report\" & ActiveWorkbook.Name
namm = ActiveWorkbook.Name
mess = "<a href=“""" & filll & """â€>" & namm & "</a>"
Set objoutlook = CreateObject("OUTLOOK.APPLICATION")
Set objolns = objoutlook.getnamespace("MAPI")
objolns.logon
With objoutlook.CreateItem(olMailItem)
.To = "paulwadsworth@XXX"
.Subject = "Daily Call Stats"
.HTMLBody = "Please find attached a hyperlink to the calls stats for
yesterday. <br>" & mess _
& "<br><br>Regards<br>Paul Wadsworth."
.Save
.Send
End With
objolns.logoff
Set objoutlook = Nothing
Set objolns = Nothing
Set objrecipient = Nothing
End Sub
That code is Exactly as I have the email, the only thing changed is my email
address. I haven't left anything out.
When I run the macro the email sends fine, but when trying to open the
hyperlink I get a "Locate Link Browser" window, and under "Types of File" I
can only select "Executable File".
I've tried without "file://" i've also tried various number of " on the
"mess =" line.
Someone I know sent me a file to mail a hyper link and the code was totally
different:
Set olApp = New Outlook.Application
Instead, but still the same error occurs.
At the end of the day, i'm trying to stop sending files on email, and send
hyperlinks instead, so that people's emails are filled up with stuff.
Can anyone help me out?