none
Office 2010 PIAs with Word(XP) RRS feed

  • Question

  • Hi,

     

    Previously we are working on Office add-ins with Office XP PIAs. It works for Office XP, 2003, 2007 and 2010. But we meet some problem for customizing the "Chart" context menu in Excel 2007, so I tried to use the Office 2010 PIAs which works by using the RibbonX technology, then we are trying to update our code to use Office 2010 PIAs for all the Office version that we supported before, at this time we meet some problem on Word XP.

     

    We have the code below:

    _theWordApp.DocumentOpen += new Word.ApplicationEvents4_DocumentOpenEventHandler(DocumentOpen);

    But while debugging, it will throw some exception.(0x80040200).

     

    In previous code which use the Office XP PIAs, the code is like this:

    _theWordApp.DocumentOpen += new Word.ApplicationEvents3_DocumentOpenEventHandler(DocumentOpen);

     

    It seems Microsoft changes the definition of the "DocumentOpen" event.

     

    Does any one know that?

    Friday, May 27, 2011 8:38 AM

Answers

  • Office PIAs don't work "backwards", only "forwards", so what you want to do isn't going to work.

    In addition, Office 2007 isn't going to support using the Ribbon to customize context menus - that's new in 2010.

    All Office applications are COM and make use of Option Parameters in the methods to allow for changes in functionality between versions. Since Office 2002 (XP) an number of things have been added to methods such as Open and SaveAs. Events may change, as well (that's why they're numbered up to 4).

    So you're probably going to need at least two versions of your add-in in order to support the changing technology across various versions.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by fmamstr Friday, May 27, 2011 9:29 AM
    Friday, May 27, 2011 9:26 AM
    Moderator

All replies

  • Office PIAs don't work "backwards", only "forwards", so what you want to do isn't going to work.

    In addition, Office 2007 isn't going to support using the Ribbon to customize context menus - that's new in 2010.

    All Office applications are COM and make use of Option Parameters in the methods to allow for changes in functionality between versions. Since Office 2002 (XP) an number of things have been added to methods such as Open and SaveAs. Events may change, as well (that's why they're numbered up to 4).

    So you're probably going to need at least two versions of your add-in in order to support the changing technology across various versions.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by fmamstr Friday, May 27, 2011 9:29 AM
    Friday, May 27, 2011 9:26 AM
    Moderator
  • Office PIAs don't work "backwards", only "forwards", so what you want to do isn't going to work.

    In addition, Office 2007 isn't going to support using the Ribbon to customize context menus - that's new in 2010.

    All Office applications are COM and make use of Option Parameters in the methods to allow for changes in functionality between versions. Since Office 2002 (XP) an number of things have been added to methods such as Open and SaveAs. Events may change, as well (that's why they're numbered up to 4).

    So you're probably going to need at least two versions of your add-in in order to support the changing technology across various versions.


    Cindy Meister, VSTO/Word MVP
    Thanks for your information!
    Friday, May 27, 2011 9:30 AM