View Single Post
 
Old 05-26-2020, 06:33 AM
Steve2081 Steve2081 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: Apr 2020
Posts: 44
Steve2081 is on a distinguished road
Default

Sub SendAsPDF()
Dim strFileName As String
Dim objOutlook As Object
Dim objMailItem As Object

strFileName = Replace(ActiveDocument.FullName, ".docm", ".pdf")
ActiveDocument.ExportAsFixedFormat OutputFileName:=strFileName, _
ExportFormat:=wdExportFormatPDF

Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(0) ' 0 = olMailItem
With objMailItem
.Subject = " Leaflet"
.Body = "This email is sent from an account we use for sending messages only. So if you want to contact us please don't reply to this message, do so by following this link for details:"
.To = ""
.Attachments.Add strFileName
.Display
End With

Kill strFileName

Set objMailItem = Nothing
Set objOutlook = Nothing
End Sub
Reply With Quote