none
Word Add in Error RRS feed

  • Question

  • We have word Add in. If we click on any menus in the ribbon we get COM error. I am inserting image with error.

    Any thoughts of any registry issues ?


    • Edited by Cindy Meister MVPModerator Friday, February 13, 2015 8:09 PM Topic is not about Word "perfect" so removed the term "perfect" from subject line
    Thursday, February 12, 2015 10:05 PM

Answers

  • Hi Arun33,

    One possibility is that there's something wrong with your code, so please debug and post the code snippet that threw this exception.

    As far as I know, there's no need to cast a Word.DocumentClass to Word.Template, the normal way is to load a template file then get the Word.Document object, for example:

    Object oTemplatePath = "C:\\temp1.dotx";
    Application app = new Application();
    Document doc = app.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);

    Another possibility is that there's something wrong with the registry entries, you may previously installed another version of Office on this computer, but something went wrong with the registry keys when you installed this new version of Office application. So you could try to repaire your Office application.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 23, 2015 7:57 AM
    Moderator

All replies

  • Hi Arun

    It's difficult to provide any specific thoughts based on the limited information you provide about your add-in. Right off-hand, I'd say your code has a line in it that's trying to use a method or property specific to a Template object on a document object. If it's happening when a (custom?) Ribbon control is clicked on, then I'd look for it in the callback code for the Ribbon...


    Cindy Meister, VSTO/Word MVP, my blog

    Friday, February 13, 2015 8:12 PM
    Moderator
  • Hi Arun33,

    One possibility is that there's something wrong with your code, so please debug and post the code snippet that threw this exception.

    As far as I know, there's no need to cast a Word.DocumentClass to Word.Template, the normal way is to load a template file then get the Word.Document object, for example:

    Object oTemplatePath = "C:\\temp1.dotx";
    Application app = new Application();
    Document doc = app.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);

    Another possibility is that there's something wrong with the registry entries, you may previously installed another version of Office on this computer, but something went wrong with the registry keys when you installed this new version of Office application. So you could try to repaire your Office application.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 23, 2015 7:57 AM
    Moderator