Hi there
I have the below code which works perfectly however I want to only export/save page 1 of the PDF not page 2.
Can anyone please tell me how I can incorporate this in to the below code?:
I have the below code which works perfectly however I want to only export/save page 1 of the PDF not page 2.
Can anyone please tell me how I can incorporate this in to the below code?:
Code:
Sub emailsavePDF_weekly()
Dim objOutlook As Object
Dim objMail As Object
Dim signature As String
Dim oWB As Workbook
Set oWB = ActiveWorkbook
Dim PDF_File As String
s = Range("b1").Value
'
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
s, Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
PDF_File = Range("b1").Value
Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
With objMail
.display
End With
signature = objMail.body
With objMail
.To = Range("A1").Value
.Cc = "test@test.co.uk"
.Subject = "Weekly League Tables for Banked vs Written " & Range("e8").Value
.body = "Dear All" _
& vbNewLine & vbNewLine & _
"Please find attached this weeks' league tables." _
& vbNewLine & vbNewLine _
& "Any questions please do not hesitate to ask." _
& vbNewLine & vbNewLine _
& "Kind Regards," _
& vbNewLine _
& "Lindsay" _
& vbNewLine _
& signature
.Attachments.Add PDF_File
.Save
.display
End With
'_
Set objOutlook = Nothing
Set objMail = Nothing
End Sub
Last edited: