Sending email with PDF attachment

Soundje

Registered User.
Local time
Today, 07:25
Joined
Aug 14, 2014
Messages
27
Hello everybody,
Can any help me what I am doing wrong; i am trying to send a email with a pdf-report attached based on a report (rap_factuur_klant_pdf).
I am using MS Access 2007 and Outlook 2007..

Code:
 Dim sAddr As String, sSubj As String, sFor As String
Again:
sAddr = InputBox("E-mail address:")
sSubj = "Report"
sFor = Left(sAddr, InStr(1, sAddr, "@") - 1)
 DoCmd.SendObject acSendReport, rap_factuur_klant_pdf, acFormatPDF, sAddr, , , sSubj, "BLA BLA BLA"
 DoEvents

Many thanks for all your help,
Koen
 
Can you give us a clue as to what your problem is, what error code or part of your VBA is highlighted?

As a start I'm pretty certain your report name will need to be in quotes "rap_factuur_klant_pdf"
 
When I execute it I am getting following error:
Error 2487 while executing:
The argument ObejectType for the action of the method is blanc or invalid

and then it highlight this line in the code:

DoCmd.SendObject acSendReport, rap_factuur_klant_pdf, acFormatPDF, sAddr, , , sSubj, "BLA BLA BLA"
 
Like I said you need to put the report name in quotes;
Code:
DoCmd.SendObject acSendReport, [COLOR="Red"]"[/COLOR]rap_factuur_klant_pdf[COLOR="red"]"[/COLOR], acFormatPDF, sAddr, , , sSubj, "BLA BLA BLA"
 
Thanks for the tip,
Now I am getting the error 2293
The message can not be send from XXX
 

Users who are viewing this thread

Back
Top Bottom