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
|