none
MS Office Addins RRS feed

  • Question

  • I hae to develop MS Office Addin using VC++ / COM. There are few queries that has to be clarified

    1) Can there be a common Addin that can work with MS Office, Excel, Access, Powerpoint etc?
    2) Is there a way we can override existing menus? For example in File can we add "Save As <Application Name>" or when Save File Dialog Box opens we add an extra customized format in "Save as types"?

    Thanks in Advance


    Adeel
    Thursday, July 7, 2011 8:02 AM

Answers

  • Hi Adeel

    I can't tell the "how", but I can perhaps give you a starting point as far as these questions are concerned

    1) Yes. IDTExtensibility2 lets you create an Office Add-in for multiple versions and multiple Office applications

    2) That depends on the version of Office you're targeting, but on the whole, the answer is probably Yes as far as over-riding menus goes.

    The third question, about adding something to the Save As types: that has nothing to do with an add-in or an Office object model. That has to do with the presence and correct registration of a file converter.


    Cindy Meister, VSTO/Word MVP
    Thursday, July 7, 2011 8:57 AM
    Moderator
  • Hi Adeel

    Office 2007 / Office 2010: This is fairly straight-forward. You include a Ribbon XML part in your Add-in with a Commands section. You set up a <command> element for each built-in command you want to override referencing the idMso of the command, with an onAction callback for the code you want to have execute. For the "extras" you use a <ribbon> section and define the tabs and groups you want to add to the Ribbon. More information can be found at
    http://msdn.microsoft.com/en-us/office/aa905530.aspx

    Office 2003 is more problematical. It bases on the CommandBars object model and there is no direct way to override the built-in commands. Instead, you'd need to remove those buttons from the toolbars and put in your own. CommandBars is more flexible than the Ribbon in that you can fully manipulate all the contents.

    Trickier is also making sure that the default actions are unlinked from the keyboard shortcuts. Whether and how that can be done will depend on each individual Office application as they all handle this differently.


    Cindy Meister, VSTO/Word MVP
    Thursday, July 7, 2011 1:22 PM
    Moderator
  • So the first thing, How can I add this option of Save As <Application Name> in the file option?

    It will work out much better for you to start a new thread for a new question. Up until now, you've mostly asked "is this possible" questions, which I've been able to answer. Now you want "how do I" and the folks who could help you with that, with code samples, aren't going to see the question, for one thing, because the subject line is wrong and secondly, because this thread has gotten so long that no one will read it that far down.

    Every time you post a new question, don't forget to mention the programming language AND the version(s) of the Office application(s) you're targeting. That will save everyone time and effort as they won't have to request the information and wait for your reply :-)

    Please mark the posts in this thread that you consider answers to your original quesitons :-)


    Cindy Meister, VSTO/Word MVP
    Friday, July 8, 2011 9:26 AM
    Moderator

All replies

  • Hi Adeel

    I can't tell the "how", but I can perhaps give you a starting point as far as these questions are concerned

    1) Yes. IDTExtensibility2 lets you create an Office Add-in for multiple versions and multiple Office applications

    2) That depends on the version of Office you're targeting, but on the whole, the answer is probably Yes as far as over-riding menus goes.

    The third question, about adding something to the Save As types: that has nothing to do with an add-in or an Office object model. That has to do with the presence and correct registration of a file converter.


    Cindy Meister, VSTO/Word MVP
    Thursday, July 7, 2011 8:57 AM
    Moderator
  •  

    2) That depends on the version of Office you're targeting, but on the whole, the answer is probably Yes as far as over-riding menus goes.

    The third question, about adding something to the Save As types: that has nothing to do with an add-in or an Office object model. That has to do with the presence and correct registration of a file converter.


    Cindy Meister, VSTO/Word MVP
    For which version of office is this option available? And then, does Microsoft allows us to override their existing menus and something extra in their File or some other Menu?

    Adeel
    Thursday, July 7, 2011 9:12 AM
  • As I said, it depends on the version of Office. Which versions are you targeting?
    Cindy Meister, VSTO/Word MVP
    Thursday, July 7, 2011 9:58 AM
    Moderator
  • As I said, it depends on the version of Office. Which versions are you targeting?
    Cindy Meister, VSTO/Word MVP


    MS Office 2010, 2007 and 2003. Is there the option of overriding their existing menus and add something Extara in its main menu?

    Example In file Menu can I add "Save file as <Application  Name Format>"?


    Adeel
    Thursday, July 7, 2011 10:30 AM
  • Hi Adeel

    Office 2007 / Office 2010: This is fairly straight-forward. You include a Ribbon XML part in your Add-in with a Commands section. You set up a <command> element for each built-in command you want to override referencing the idMso of the command, with an onAction callback for the code you want to have execute. For the "extras" you use a <ribbon> section and define the tabs and groups you want to add to the Ribbon. More information can be found at
    http://msdn.microsoft.com/en-us/office/aa905530.aspx

    Office 2003 is more problematical. It bases on the CommandBars object model and there is no direct way to override the built-in commands. Instead, you'd need to remove those buttons from the toolbars and put in your own. CommandBars is more flexible than the Ribbon in that you can fully manipulate all the contents.

    Trickier is also making sure that the default actions are unlinked from the keyboard shortcuts. Whether and how that can be done will depend on each individual Office application as they all handle this differently.


    Cindy Meister, VSTO/Word MVP
    Thursday, July 7, 2011 1:22 PM
    Moderator
  • Hi Adeel

    Office 2007 / Office 2010: This is fairly straight-forward. You include a Ribbon XML part in your Add-in with a Commands section. You set up a <command> element for each built-in command you want to override referencing the idMso of the command, with an onAction callback for the code you want to have execute. For the "extras" you use a <ribbon> section and define the tabs and groups you want to add to the Ribbon. More information can be found at
    http://msdn.microsoft.com/en-us/office/aa905530.aspx

    Office 2003 is more problematical. It bases on the CommandBars object model and there is no direct way to override the built-in commands. Instead, you'd need to remove those buttons from the toolbars and put in your own. CommandBars is more flexible than the Ribbon in that you can fully manipulate all the contents.

    Trickier is also making sure that the default actions are unlinked from the keyboard shortcuts. Whether and how that can be done will depend on each individual Office application as they all handle this differently.


    Cindy Meister, VSTO/Word MVP


    Thanks Cindy. Now I got the actual requirement from the client. They Need a menu in save as option with the name of save to <Application Name>.  When the user clicks that save to <Application Name>.  It should save the file in the user specified location and need to call a main plug in application using shell execute by passing the location of the file.


    Adeel
    Friday, July 8, 2011 4:17 AM
  • So the first thing, How can I add this option of Save As <Application Name> in the file option?
    Adeel
    Friday, July 8, 2011 4:18 AM
  • So the first thing, How can I add this option of Save As <Application Name> in the file option?

    It will work out much better for you to start a new thread for a new question. Up until now, you've mostly asked "is this possible" questions, which I've been able to answer. Now you want "how do I" and the folks who could help you with that, with code samples, aren't going to see the question, for one thing, because the subject line is wrong and secondly, because this thread has gotten so long that no one will read it that far down.

    Every time you post a new question, don't forget to mention the programming language AND the version(s) of the Office application(s) you're targeting. That will save everyone time and effort as they won't have to request the information and wait for your reply :-)

    Please mark the posts in this thread that you consider answers to your original quesitons :-)


    Cindy Meister, VSTO/Word MVP
    Friday, July 8, 2011 9:26 AM
    Moderator