The code I have below works as I want, except
It saves the whole workbook as pdf and I would like to save only "Sheet6"
It also does not insert my signature in outlook which I need
Any help to modify this would be appreciated.
It saves the whole workbook as pdf and I would like to save only "Sheet6"
It also does not insert my signature in outlook which I need
Any help to modify this would be appreciated.
VBA Code:
Sub Email_From_Excel_English()
Dim emailApplication As Object
Dim emailItem As Object
Dim strPath As String
Dim lngPos As Long
' Build the PDF file name
strPath = ActiveWorkbook.FullName
lngPos = InStrRev(strPath, ".")
strPath = Left(strPath, lngPos) & "pdf"
' Export workbook as PDF
ActiveWorkbook.ExportAsFixedFormat xlTypePDF, strPath
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
' Now we build the email.
emailItem.To = Range("C4")
emailItem.Subject = "Roofing Estimate"
emailItem.Body = "Please find attached your estimate, as well as a copy of our terms and conditions." & vbNewLine & vbNewLine & " If you have any questions, please do not hesitate to contact me." & vbNewLine & vbNewLine & "Regards," & vbNewLine & vbNewLine & signature
' Attach the PDF file
emailItem.Attachments.Add strPath
emailItem.Attachments.Add "C:\Users\Nick\Dropbox\1Nick\2022_Nick\Terms Conditions ENG.pdf"
' Send the Email
' Use this OR .Display, but not both together.
emailItem.Display
' Display the Email so the user can change it as desired before sending it
' Use this OR .Send, but not both together.
'emailItem.Display
Set emailItem = Nothing
Set emailApplication = Nothing
' Delete the PDF file
Kill strPath
End Sub