Hello,
I have a spreadsheet that sends an email after the file has been uploaded to a SharePoint sight. The email has a hyperlink to the SharePoint site address to where the file was uploaded.
I want to give that hyperlink an alias so that the email will look alot neater than it does now. My code works, but the syntax is what I need to create the alias.
I know that you can use code similar to what's below.
Hyperlinks.Add Anchor:=" ", Address:=" ", TexttoDisplay:=" "
The code above doesn't work in my code. Am I missing a reference or what?
Here is a sample of my code:
Anyone's help is greatly appreciated.
I have a spreadsheet that sends an email after the file has been uploaded to a SharePoint sight. The email has a hyperlink to the SharePoint site address to where the file was uploaded.
I want to give that hyperlink an alias so that the email will look alot neater than it does now. My code works, but the syntax is what I need to create the alias.
I know that you can use code similar to what's below.
Hyperlinks.Add Anchor:=" ", Address:=" ", TexttoDisplay:=" "
The code above doesn't work in my code. Am I missing a reference or what?
Here is a sample of my code:
Code:
strHyper = "[URL unfurl="true"]http://s.corporate.s.local/sites/team/S/Forms/AllItems.aspx"[/URL]
ESubject = "Daily Report for " & strPeriod
EFrom = " "
ETo = "Name"
'Use below for multiple names
'ETo = "Names"
'ECc = "Names"
EBcc = " "
If Format(Time, "hhmm") < 1200 Then
EBody = "Good Morning All," & vbCrLf & vbCrLf & _
"A refreshed version of your report for " & strPeriod & " day " & strPerDay & " has been posted to the link below:" & _
vbCrLf & vbCrLf & _
strHyper & vbCrLf & vbCrLf & _
"Automated Reporting System" & vbCrLf & _
"[URL unfurl="true"]www.s.com"[/URL]
Else
EBody = "Good Afternoon All," & vbCrLf & vbCrLf & _
"A refreshed version of your report for " & strPeriod & " day " & strPerDay & " has been posted to the link below:" & _
vbCrLf & vbCrLf & _
strHyper & vbCrLf & vbCrLf & _
"Automated Reporting System" & vbCrLf & _
"[URL unfurl="true"]www.s.com"[/URL]
End If
On Error GoTo debugs
Set MObj = CreateObject("Outlook.Application")
Set MSingle = MObj.CreateItem(0)
With MSingle
.Subject = ESubject
.To = ETo
.cc = ECc
.BCC = EBcc
.Body = EBody
.send
End With
Anyone's help is greatly appreciated.