Question : Email report in PDF gives error

Hi,

I have this code to mail a report in PDF, If the user quits the mail it gives an error:
Run-Time error 2501
The sendobject action was canceled.

Q1: How can I disable this error?
Q2: How can I change the name of the pdf attachment from "HighLight.pdf" into HighLight-"Form_Start.KlantenNummer".pdf?

Thanks,
HP
Code Snippet:
1:
2:
3:
4:
Dim strReportName As String
strReportName = "HighLight"

       DoCmd.SendObject acReport, strReportName, acFormatPDF, "", , , "Highlight overzicht: " & Form_Start.KlantenNummer & " - " & Form_Start.ProjectNaam & " - " & Form_ProjectTodo.Startdatum, , True

Answer : Email report in PDF gives error

ooops


ON Error GoTo Err_Handler
Dim strReportName As String
strReportName = "HighLight"
 
       DoCmd.SendObject acReport, strReportName, acFormatPDF, "", , , "Highlight overzicht: " & Form_Start.KlantenNummer & " - " & Form_Start.ProjectNaam & " - " & Form_ProjectTodo.Startdatum, , True


OpenInNewWindow:
Open in New WindowSelect All



Exit_ThisSub:
    Exit Sub

Err_Handler:
    If Err.Number = 2501 Then GoTo OpenInNewWindow
    MsgBox Err.Number & ", " & Err.Description, , "Error"
    Resume Exit_ThisSub
Random Solutions  
 
programming4us programming4us