Problems emailing using Crystal ActiveX Control

Posted on 2001-07-01
Medium Priority
Last Modified: 2011-04-14

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.
Question by:dinoang22
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Expert Comment

ID: 6243791
Hi dinoang22,

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



Author Comment

ID: 6243813
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.

Expert Comment

ID: 6243902
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 :



On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.


Author Comment

ID: 6244149
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

Expert Comment

ID: 6244310
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 all...it's fine with me :-)



Accepted Solution

jrmn earned 600 total points
ID: 6244430
Opps, I forgot to mark my previous entry as an answer..sorry  ;-)

Author Comment

ID: 6247266
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.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question