Good Day
I have the following code that emails a single sheet to a email in the sheet.
I noticed that it saves a copy of the sheet in pdf - I would like that but can not seem to find where to tell it to save the PDF file
currently it seems to save to my documents but I would like to have it saved to a SharePoint folder - So even if different users use it, it saves to the same folder.
Sub Send_Email()
Dim wPath As String, wFile As String
wPath = ThisWorkbook.Path
wFile = "Filepdf.pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("d3"), _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = Range("b39")
dam.Subject = Range("d3")
dam.Body = "Regards"
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
End Sub
I have the following code that emails a single sheet to a email in the sheet.
I noticed that it saves a copy of the sheet in pdf - I would like that but can not seem to find where to tell it to save the PDF file
currently it seems to save to my documents but I would like to have it saved to a SharePoint folder - So even if different users use it, it saves to the same folder.
Sub Send_Email()
Dim wPath As String, wFile As String
wPath = ThisWorkbook.Path
wFile = "Filepdf.pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("d3"), _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = Range("b39")
dam.Subject = Range("d3")
dam.Body = "Regards"
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
End Sub