Problems emailing using Crystal ActiveX Control
Posted on 2001-07-01
I am having a serious problem since I upgraded to Crystal 7.0. My program now seems to be behaving very weirdly whenever I try to email out a report. I am using Visual Basic 6.0 on Winme using an Access database via ODBC for the development platform
I don't know whether any of you have experienced this before, but my application would be able to email out for the very first time, then after that, when I try to email again, I would always get an error message
"20545 User Has Canceled Operation. The user has clicked the Cancel button in a dialog box during the session.". Funny thing is I did not touch anything...
I have to shut down the application and start it again, then it will behave exactly in the same manner. Very weird. However, when I check my Outlook Outbox, I can see the email there. Weird!!!
When I was using Crystal 5.0, I did not face this problem.
I tried to export to MAPI from the Crystal Report Designer, and it work without any problem, which shows my MAPI has been configured properly. So what the hell is wrong here??? Is it a bug?
Here is the sample code I am using. Report1 is the name of the Crystal Reports ActiveX component.
Report1.ReportFileName = "C:\TEST.RPT"
Report1.Destination = crptMapi
Report1.PrintFileType = crptCrystal
Report1.PrintFileName = PathName.Text
Report1.EMailToList = "TEST@TEST.COM"
Report1.EMailCCList = ""
Report1.EMailSubject = "HELLO"
Report1.EMailMessage = "MESSAGE BODY"
Report1.Action = 1
It looks correct isn't it? I don't see any problems with it, since the report could print to the printer and screen.
Please help as I have been trying to solve this problem for the past 2 weeks. I have tried opting to use the CRPE API engine, but the manual says I cannot use the CRPE and the ActiveX control in the same application, and the CRPE engine seems to be very much complicated to use then the ActiveX component.
Please give me a solution, anything to solve this mystery.
Thanks a lot.