none
how to disable add-in security message on word startup RRS feed

  • Question

  • Hi,

    I have a add-in for Microsoft word. but sometimes if I will abruptly close the word application then on next time of start up I am getting a security message asking for "do you want to disable this add-in?"

    I don't want this message, how I can disable this in c# .net programming.

    Thanks.

    Monday, August 31, 2015 6:34 AM

Answers

  • Hello James,

    Most probably your add-in couldn't shut down correctly, i.e. an exceptions was thrown in the code of your add-in. So, I'd suggest debugging the code and adding any logging mechanisms for preventing any exceptions/errors in the code. For example, you may use the log4net assembly for logging all operations/calls in the code.

    • Marked as answer by James Shokeen Tuesday, September 1, 2015 10:58 AM
    Monday, August 31, 2015 7:03 AM

All replies

  • Hello James,

    Most probably your add-in couldn't shut down correctly, i.e. an exceptions was thrown in the code of your add-in. So, I'd suggest debugging the code and adding any logging mechanisms for preventing any exceptions/errors in the code. For example, you may use the log4net assembly for logging all operations/calls in the code.

    • Marked as answer by James Shokeen Tuesday, September 1, 2015 10:58 AM
    Monday, August 31, 2015 7:03 AM
  • thanks for reply.

    but is there any way to disable this even if it is not shut down correctly?

    Monday, August 31, 2015 8:50 AM
  • Hi James

    <<but is there any way to disable this even if it is not shut down correctly?>>

    No, this is correct behavior for Office if an add-in does not shut down correctly. The Office application cannot know what made it "crash", except to look at add-ins that did not unload correctly and give the user the opportunity to disable them in order to prevent future crashes. From experience "everyone" knows that a "bad" add-in can prevent a user from working correctly. A mechanism is therefore needed to let the user put any add-in aside that may be preventing the Office application from working correctly.

    Given the description of your situation, you should avoid closing Word "abruptly" and use the normal Exit path. If Word is not responding, then you need to follow Eugene's advice and fix the Add-in.


    Cindy Meister, VSTO/Word MVP, my blog

    Monday, August 31, 2015 2:00 PM
    Moderator