adxOutlookEvents_ItemSend called twice

Add-in Express™ Support Service
That's what is more important than anything else

adxOutlookEvents_ItemSend called twice
 
Thomas Grossen




Posts: 134
Joined: 2005-10-21
Hi,

Something strange appends when Word is the email editor;

If I cancel the send event in adxOutlookEvents_ItemSend (e.cancel = true), the event is called a second time. This does not append if e.cancel is set to false, and also does not append if word is not the default email editor.

It is like Word try to send twice if the sending was cancelled.

Do you have any explication? Or how can I work around?

Thank you,

Thomas
Thomas.
Posted 18 Mar, 2006 05:28:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Hi Thomas.

I can't reproduce this issue on my PC.
What version of Outlook do you use?
Posted 20 Mar, 2006 11:36:46 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
Ok. I make some other testing, and what I found, it's that only occurs when you send the mail by code, and not with the "send button".

Here is the code that reproduce it. I just sent you an email with the entire project, if it can help you.

 
       void adxCommandBarButton1_Click(object sender)
        {
            Outlook._Inspector olInsp = ((Outlook.Application)HostApplication).ActiveInspector();
            object olItem = olInsp.CurrentItem;
            Outlook._MailItem olMail = (Outlook._MailItem)olItem;

            try
            {
                olMail.Send();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message, "Test", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
            }
        }


        void adxOutlookEvents_ItemSend(object sender, AddinExpress.MSO.ADXOlItemSendEventArgs e)
        {
            nCounter++;
            System.Windows.Forms.MessageBox.Show(nCounter.ToString(), "counter", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
            e.Cancel = true;
        }



I have Office 2003, but it is the same on Office XP. Running Windows XP, VS 2005.

Thank you,

Thomas.
Thomas.
Posted 21 Mar, 2006 11:08:23 Top
Sergey Grischenko


Add-in Express team


Posts: 7235
Joined: 2004-07-05
Hi Thomas.

I received the code. I will test it.
Posted 21 Mar, 2006 13:41:49 Top
Thomas Grossen




Posts: 134
Joined: 2005-10-21
ok. Thank you.

Let me know if you need something else.

Thomas.
Thomas.
Posted 21 Mar, 2006 14:53:56 Top