Page 1 of 1

Custom Email Processing don't work as expected

Posted: Mon Nov 30, 2015 1:07 pm
by mRek
Stimulversion: 2014.3.0.0
Win 8.1
.NET 4.0
Office 2013

Hello, I have some problems with customizing the Email-Processing.
The goal is to "disable" the Save-Dialog after clicking SendEmail by creating a temporary file.
So far I generate a StiPreviewForm with my ReportObject and register a special ProcessSendEmail procedure:

Code: Select all

var previewForm = new StiPreviewForm(m_ReportObject);
previewForm.ViewerControl.ProcessSendEMail += CustomSendEmailProcessing;
m_ReportObject.ViewerControl = previewForm.ViewerControl;

if (asDialog)
{
    previewForm.ShowDialog();
}
else
{
    previewForm.Show();
}

Code: Select all

private void CustomSendEmailProcessing(object sender, EventArgs e)
{
     var service = sender as StiExportService;

     if (service != null)
     {
          var temp = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(m_ReportObject.ReportFile) + DateTime.Now.ToString("dd-MM-yyyy_HH-mm-ss")
                 +     "." + service.DefaultExtension);
          service.Export(m_ReportObject, temp, true);

          File.Delete(temp);
     }
}
This code works partly as expected, but if I exit the Emailing-Window of Outlook by Close-Button, a secound Emailing-Window without any email attachments opens.
It seems like the ProcessSendEmail proceed with the standard SendEmail-procedure if the first time is canceled.
Is there a way to suppress this behavior?

Re: Custom Email Processing don't work as expected

Posted: Tue Dec 01, 2015 10:30 am
by Alex K.
Hello,

We couldn't reproduce this bug.
Please check the last version. If the issue still present please send us a simple project which reproduce the issue and step by step guide how to reproduce.

Thank you.

Re: Custom Email Processing don't work as expected

Posted: Wed Dec 02, 2015 8:54 am
by mRek
Hi, thanks for the quick response.
The (now fixed) problem was a corrupted MAPI32.dll by Office Upgrading. Now everything works as expected.

Thanks anyway and have a nice day!

Re: Custom Email Processing don't work as expected

Posted: Wed Dec 02, 2015 9:12 am
by Alex K.
Hello,

Let us know if you need any additional help.

Thank you.