Problems emailing using Crystal ActiveX Control


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.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

jrmnConnect With a Mentor Commented:
Opps, I forgot to mark my previous entry as an answer..sorry  ;-)
Hi dinoang22,

Try reading these k-base articles from crystal reports site. Maybe one of these will solve you problem :

dinoang22Author Commented:
Hi jrmn,

Thanks for the info. The article

answered the problem I was facing. So indeed it was a problem with Crystal Reports 7 and not my program code. This is really annoying, seagate software should have made their codes backward compatible. The solution given by them would have to code the MAPI profile into your source code. Of course I could have added a MAPI setup first in my program, but it too troublesome since my customer is already using the software in 4 countries.

I tried the code provided but I still am getting the same error message. I'm wondering why?  The suggested code was :-

Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
'Return a reference to the MAPI layer
Set ns = ol.GetNamespace("MAPI")
'Logon to Outlook and then create a new session
'The first argument in the Logon method will be the name of your MAPI profile (i.e. Outlook Profile)
ns.Logon "MS MAPI Settings", "", False, True

I am seeking a new way to overcome this using the CRPE API engine. Its exactly the same engine that the Crystal Report Designer program is using.

I believe everyone who is using the Export function to MAPI is facing this problem. Does Seagate have a patch or something?

Anyway, thanks for the help. Any comments would be welcome.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hi dinoang22,

There's another article related to this problem but this is for automation server. Just read this you might get some ideas here:

Actually, there are various updates for crystal reports 7 but I'm not sure if they'll fix the problem you have above.
There are lot of new stuffs in version 8 and 8.5 but I can't guarantee if these new versions will solve your problem as I haven't done the thing you presented here.
Perhaps other experts can give you a sort of an "overview" later on if your problem can be solve with the latest version.
Anyway, if you're intested enough, check the links below as these leads you to update files for crystal reports 7.0 :


dinoang22Author Commented:
Hi Jrmn,

Thanks for the Info. I'll try the patches and see. Anyway, I got the earlier code working. However, I have to declare the MAPI profile inside the VB code. I was thinking of adding a MAPI setup in my program to allow the user to select the MAPI profile of their choice before emailing using Crystal Reports.

Do you know how to list the MAPI profile of a machine in VB 6?

Thanks a lot
Hi dinoang22,

Unfortunately, I don't have any experience programming using VB as I'm using Delphi as a development tool.

I went to the Visual Basic area on EE and search for any topic related to MAPI. Well, I found a lot of it there.
Just take a look for yourself and see which of those topics suits your need.

I'm glad to hear that you have "partially" solve your problem. :-)

I'll make this comment an answer in the assumption that it helped you in a way or 2 and that other users can get something from this one later on in case they'll encounter the same or similar problem.

Just reject it if you feel the solutions I gave you doesn't help you at's fine with me :-)


dinoang22Author Commented:
Hi jrmn,

Your solution provided me an insight on how to solve the problem. The article which you asked me to view at

seems to have provided me a clue and with some additional research, I was able to get my application and Crystal Reports working with MAPI.

Again, thanks for the help. It has really ease my nerve on this issue and I can move on.

Cheers dude, you deserve the points.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.