Thread: SendMail
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
fred fred is offline
external usenet poster
 
Posts: 73
Default 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