none
Cutom Outlook Add-in is conflicting with SalesForce's Outlook add-in RRS feed

  • Question

  • Hello,

    We've developed one custom MS outlook add-in and installed it for Microsoft Outlook 2013.
    It is failing with some of the functionalities where SalesForce's Outlook add-in is deployed and activated.

    As soon as user deactivates it, our custom add-in runs as expected.

    Technical details:
    In our custom outlook add-in, we've attached an event handler with MailItem's SENT folder's ItemAdded event. 
    The code of this event gets triggered and do the job only when user disables the SalesForce's Outlook add-in.

    Can anybody please advise how to get rid of this conflict? It's really urgent.

    Any help would be much appreciated.

    Thanks,
    Ankit


    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Saturday, March 14, 2015 3:03 PM

Answers

  • This will work for a couple seconds only before the implicit variable holding the Items collection from the

    mailItemSendFolder.Items.ItemAdd += SentItems_ItemAdd;

    line is release by the Garbage Collector.

    You must store the object raising the event (mailItemSendFolder.Items) is a separate variable or list to make sure it does not go out of scope and get garbage collected.

    l


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, March 16, 2015 6:02 AM
  • Hello Dmitry,

    The problem is resolved now, by mistake I created a variable for mailItemSendFolder and not for Items collections i.e. mailItemSendFolder.Items

    Once I declared variable for mailItemSendFolder.Items, everything worked as expected.

    Once again thank you for your quick support.


    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Monday, March 16, 2015 11:56 AM

All replies

  • Hello Ankit,

    Do you get any exceptions in the code? Did you try to debug the add-in?

    The ItemAdd event is not fired when multiples items added at the same time (more than 16). Is that the case?

    BTW Have you tried to contact the add-in developer?

    Saturday, March 14, 2015 3:33 PM
  • How do you set up the event handler and what doers the event handler do? Please post the relevant snippets of your code.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, March 14, 2015 11:27 PM
  • Hello Eugene,<o:p></o:p>

    Thank you for the response.<o:p></o:p>

    I myself am the developer & am facing this issue with one of my clients. <o:p></o:p>

    As we do not license of the Salesforce add-in, we are unable to debug in our
    environment.<o:p></o:p>

    Yes, I am aware of the "more than 16" case & this is not the case here.<o:p></o:p>

    Could you guide further?<o:p></o:p>

    Thanks.<o:p></o:p>



    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com


    Monday, March 16, 2015 5:56 AM
  • Hello Dmitry,

    Thank you for the response.

    I would like to explain the flow again -

    1. I have given a custom button in the ribbon - "Send"

    2. On click of that button, I add a custom property to my mail item object & call the .Send() method on it.

    3. Eventually, I get my "Application_ItemSend" event handler called where I check for the custom property on the mailItem & if found, I attach the "ItemAdd" handler as below -

    //Attach the Event Handler.

    mailItemSendFolder = mailItem.SaveSentMessageFolder;

    mailItemSendFolder.Items.ItemAdd += SentItems_ItemAdd;

    4. In ideal situation, my "SentItems_ItemAdd" is getting called. But on machine where we have this salesforce add-in enabled/active, this event handler is not getting called & hence, my functionality is not getting executed.

    Hope, I have made the implementation more clear.

    Request you to please feel free to come up with any additional queries (if any).

    Thanks.


    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Monday, March 16, 2015 5:59 AM
  • This will work for a couple seconds only before the implicit variable holding the Items collection from the

    mailItemSendFolder.Items.ItemAdd += SentItems_ItemAdd;

    line is release by the Garbage Collector.

    You must store the object raising the event (mailItemSendFolder.Items) is a separate variable or list to make sure it does not go out of scope and get garbage collected.

    l


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, March 16, 2015 6:02 AM
  • Hello Dmitry,

    Thank you for the quick response.

    Yes, we will make this change in code, but I'm still not sure whether it will help in our case or not.

    I'm still unable to understand how is it related to SalesForce add-in, when we disable this add-in on client's machine, the event gets triggered well on all attempts without any problems.

    Could you shed some more light on this point? Do you really think it will resolve the aforementioned conflict?

    Thanks,

    Ankit


    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com


    Monday, March 16, 2015 6:37 AM
  • That addin can take additional time to proceed giving the Garbage Collector a chance to run. Or it could call GC.Collect() to trigger an immediate garbage collection rendering your event handler invalid.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, March 16, 2015 6:56 AM
  • Hello Dmitry,

    Thank you for the explanation.

    I've just deployed the updated add-in at client machine, but unfortunately it won't work.

    Our add-in is still not working with SalesForce CRM add-in. Any other suggestions.

    Thanks,

    Ankit


    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Monday, March 16, 2015 9:30 AM
  • Have you tried setting up the Items_Add event handler for the Sent Items folder when your addin starts up rather than hooking it only if a sent item has a custom user property deifned?
    Monday, March 16, 2015 11:50 AM
  • Hello Dmitry,

    The problem is resolved now, by mistake I created a variable for mailItemSendFolder and not for Items collections i.e. mailItemSendFolder.Items

    Once I declared variable for mailItemSendFolder.Items, everything worked as expected.

    Once again thank you for your quick support.


    Thanks, <b>Ankit Shah</b> <hr> Inkey Solutions, India. <hr> Microsoft Certified Business Management Solutions Professionals <hr> http://ankit.inkeysolutions.com

    Monday, March 16, 2015 11:56 AM