none
VSTO Addin Save/Open override RRS feed

  • Question

  • Hi,

    I have developed an addin for Excel and Word. It overrides the save and open functionalities. If I click the Save icon on the toolbar or Ctrl + S, it works always. But if I click the Office button > Save Or Office button > Open menu items, it sometimes works and sometimes doesn't do anything.

    Could anyone please help me to fix this issue?

    Thanks,


    • Edited by Mathew_V Monday, August 4, 2014 10:38 PM
    Monday, August 4, 2014 9:30 PM

Answers

All replies

  • Hi,

    How do you "overrides the save and open functionalities"? Would you mind sharing a sample code for us to reproduce and troubleshoot?

    Have you tried to run it in other machines?


    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.

    Tuesday, August 5, 2014 8:56 AM
    Moderator
  • Hello Mathew,

    Command bars are not used any longer in Office applications. Instead, the Fluent UI (aka Ribbon UI) is used instead. You can read more about this in the following series of articles in MSDN:

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)

    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

    You can intercept controls on the ribbon. See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

    Most probably you were unable to repurpose backstage controls. The Introduction to the Office 2010 Backstage View for Developers article states the following:

    Can I repurpose one of the existing definitive command buttons, fast command buttons, or tabs by changing its onAction callback attribute? For example can I change the file Save button so that is has an additional type, or displays only one file type?

    It is not possible to override these commands from the custom UI XML markup or by using the object model. Using the DocumentBeforeSave event is one alternative, but using that doesn't really change the functionality of the individual commands that show up in the Change File Type gallery in the Backstage. A better solution would be to consider hiding the built-in UI and rebuilding it fully with custom commands.

    You may find the Customizing the Office 2010 Backstage View for Developers helpful.

    Tuesday, August 5, 2014 9:29 AM
  • Thanks Luna. Sorry for the delayed reply.

    I am repurposing the Save and Open functionalities by modifying the Ribbon.xml file. For Save, I override the FileSave. The addin has been developed using Visual Studio 2008. It works with Office 2007 and 2010 in Windows 7 and Windows 8.

    The only problem is, it sometimes doesn't respond to File > Save or Office Button > Save menu item. For example, if I continuously try File > Save for 20 times, it would ignore it 3-4 times. But it always work if I click on the save icon on the toolbar or Ctrl + S. This happens in office 2007 and office 2010 and not in all machines. I am using virtual machines for testing in different environment. In some VMs this problem is not occuring, but they have the  same configurations. So struggling to find the cause.

    Thanks,

    Monday, August 11, 2014 11:58 PM
  • Hello Mathew,

    Would you please share us with your sample code to override save functionalities?

    Thanks in advance

    Wednesday, February 14, 2018 6:43 AM