Hi,
have the code below which works good, this one add the link for the spreadsheet on body of the email to click to open, how can I modify it that it can also add the link of the backup that is pdf format located in the same folder.
Here the code:
Thank you,
have the code below which works good, this one add the link for the spreadsheet on body of the email to click to open, how can I modify it that it can also add the link of the backup that is pdf format located in the same folder.
Here the code:
VBA Code:
Sub Make_Outlook_Mail_With_File_Link()
'Working in Excel 2000-2016
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
If ActiveWorkbook.Path <> "" Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "<font size=""3"" face=""Calibri"">" & _
"Hi Afia,<br><br>" & _
"<br><B>" & _
ActiveWorkbook.Name & "</B> is created.<br>" & _
"Please click on this link to open the file : " & _
[B][COLOR=rgb(226, 80, 65)] "<A HREF=""file://" & ActiveWorkbook.FullName & _
""">Link to the file</A>" & _[/COLOR][/B]
"<br><br>Note: The EFT backup link is on the spreadsheet...." & _
"<br><br>Thank you," & _
"<br><br></font>"
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "RE: " & Range("SUBJECT").Value 'ActiveWorkbook.Name
.HTMLBody = strbody
.Display 'or use .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Else
MsgBox "The ActiveWorkbook does not have a path, Save the file first."
End If
End Sub
Thank you,