ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SendMail (https://www.excelbanter.com/excel-programming/440067-sendmail.html)

fred

SendMail
 
Hi,
how can I create an email with an attachment using the SendMail dialog.
When I record a macro and "Send: Email as PDF Attachment" I get

Sub Macro1()
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\DOCUME~1\ME~1.COM\LOCALS~1\Temp\REOI11.pdf ",
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False,
OpenAfterPublish:=False
Application.Dialogs(xlDialogSendMail).Show
End Sub

Running this macro does not work as it attaches the full Excel workbook to
the email. The ExportAsFixedFormat does work as it does create a the PDF
file, but this PDF file does not get attached to the email.
How can I get the file "C:\DOCUME~1\ME~1.COM\LOCALS~1\Temp\REOI11.pdf " to be
the attachment on the email.

Thanks for any help
Fred




All times are GMT +1. The time now is 04:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com