Hi There Experts
I need some help with Something.
I a make use of the VBA code below to convert my excels worksheet to PDF and then e-mail it.
I need some help i need my e-mail signature to also show. I have made the section where i need the signature bold and red. Hope the info supplied helps.
Please let me know if you need anything else form me.
Thank you
DeWaal
Private Sub CommandButton1_Click()
'Create a PDF and mail of every sheet with a mail address in cell A1 (Sheet5 and sheet6)
'You see that the code create two mails, one with sheet5 and one with sheet6 and send it
'to the address in A1 of that sheet.
'Working only in 2007 and up
Dim sh As Worksheet
Dim TempFilePath As String
Dim TempFileName As String
Dim FileName As String
'Temporary path to save the PDF files
'You can also use another folder like
'TempFilePath = "C:\Users\Ron\MyFolder\"
TempFilePath = "C:\Users\DeWaal @ Mervak\Desktop\"
'Loop through every worksheet
For Each sh In ThisWorkbook.Worksheets
FileName = ""
'Test A1 for a mail address
If sh.Range("C19").Value Like "?*@?*.?*" Then
'If there is a mail address in A1 create the file name and the PDF
TempFileName = TempFilePath & " " & sh.Name & " " _
& ThisWorkbook.Name & " " & ".pdf"
FileName = RDB_Create_PDF(sh, TempFileName, True, False)
'If publishing is OK create the mail
If FileName <> "" Then
RDB_Mail_PDF_Outlook FileName, sh.Range("C19").Value, "Quotation - MVA Aluminium (Pty) Ltd", _
"Hi " & sh.Range("C13").Value _
& vbNewLine & vbNewLine & "Hope all is well." _
& vbNewLine & vbNewLine & "Please find attached your quotation for the glass and aluminium for your site at " & sh.Range("C18").Value _
& vbNewLine & vbNewLine & "Don't hesitate to contact me if there is anything you don't understand or if we can help with anything else." _
& vbNewLine & vbNewLine & "Thank You and Kind Regards" _
& vbNewLine & "(I NEED MY SIGNATURE HERE)", False
'After the mail is created delete the PDF file in TempFilePath
If Dir(TempFileName) <> "" Then Kill TempFileName
Else
MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
"Microsoft Add-in is not installed" & vbNewLine & _
"The path to Save the file in arg 2 is not correct" & vbNewLine & _
"You didn't want to overwrite the existing PDF if it exist"
End If
End If
Next sh
End Sub
I need some help with Something.
I a make use of the VBA code below to convert my excels worksheet to PDF and then e-mail it.
I need some help i need my e-mail signature to also show. I have made the section where i need the signature bold and red. Hope the info supplied helps.
Please let me know if you need anything else form me.
Thank you
DeWaal
Private Sub CommandButton1_Click()
'Create a PDF and mail of every sheet with a mail address in cell A1 (Sheet5 and sheet6)
'You see that the code create two mails, one with sheet5 and one with sheet6 and send it
'to the address in A1 of that sheet.
'Working only in 2007 and up
Dim sh As Worksheet
Dim TempFilePath As String
Dim TempFileName As String
Dim FileName As String
'Temporary path to save the PDF files
'You can also use another folder like
'TempFilePath = "C:\Users\Ron\MyFolder\"
TempFilePath = "C:\Users\DeWaal @ Mervak\Desktop\"
'Loop through every worksheet
For Each sh In ThisWorkbook.Worksheets
FileName = ""
'Test A1 for a mail address
If sh.Range("C19").Value Like "?*@?*.?*" Then
'If there is a mail address in A1 create the file name and the PDF
TempFileName = TempFilePath & " " & sh.Name & " " _
& ThisWorkbook.Name & " " & ".pdf"
FileName = RDB_Create_PDF(sh, TempFileName, True, False)
'If publishing is OK create the mail
If FileName <> "" Then
RDB_Mail_PDF_Outlook FileName, sh.Range("C19").Value, "Quotation - MVA Aluminium (Pty) Ltd", _
"Hi " & sh.Range("C13").Value _
& vbNewLine & vbNewLine & "Hope all is well." _
& vbNewLine & vbNewLine & "Please find attached your quotation for the glass and aluminium for your site at " & sh.Range("C18").Value _
& vbNewLine & vbNewLine & "Don't hesitate to contact me if there is anything you don't understand or if we can help with anything else." _
& vbNewLine & vbNewLine & "Thank You and Kind Regards" _
& vbNewLine & "(I NEED MY SIGNATURE HERE)", False
'After the mail is created delete the PDF file in TempFilePath
If Dir(TempFileName) <> "" Then Kill TempFileName
Else
MsgBox "Not possible to create the PDF, possible reasons:" & vbNewLine & _
"Microsoft Add-in is not installed" & vbNewLine & _
"The path to Save the file in arg 2 is not correct" & vbNewLine & _
"You didn't want to overwrite the existing PDF if it exist"
End If
End If
Next sh
End Sub