Hi,
have the vba code below that the workbook as attachment automatically there's also pdf backup is there away to add the pdf file automatically as attachment as well.
code:
Thank you,
have the vba code below that the workbook as attachment automatically there's also pdf backup is there away to add the pdf file automatically as attachment as well.
code:
Rich (BB 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>" & _
"Please process NCL EFT saved on:" & "</B><br><br>" & _
"Link to open the file: " & _
"<A HREF=""file://" & ActiveWorkbook.FullName & _
""">Link to the file</A>" & "</B> <br> <br>" & _
"" & "</B><br>" & _
"Link to open the backup: " & _
"<A HREF=""file://" & NetworkPath & ActiveWorkbook.ActiveSheet.Range("E3") & _
""">Link to the file</A>" & _
"<br><br>Note: The EFT backup link is on the spreadsheet as well...." & _
"<br><br>Thank you," & _
"<br><br></font>"
On Error Resume Next
With OutMail
.To = "afia.amaniampong@distributel.ca"
.CC = ""
.BCC = ""
.Subject = "" & Range("SUBJECT").Value 'ActiveWorkbook.Name
.Attachments.Add Application.ActiveWorkbook.FullName
.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
Thank you,
Last edited by a moderator: