none
FileSave operation fails to execute RRS feed

  • Question

  • This is in VS2010 & Word 2010.  I am providing a callback in my xml template to control when the 'FileSave' can be enabled. Now I notice that the built-in operation does not execute regardless of the enabled state. 

    Any info about how to get the original operation to execute?


    • Edited by cmm-Cliff Thursday, September 22, 2011 7:52 PM
    Thursday, September 22, 2011 7:49 PM

Answers

  • Hi et-Cliff,

    Thanks for your post.

    I'm not aware of how you custom your backstage, but here is how I custom built-in control of backstage:

    The XML part should be something like:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <commands >
        <command  idMso ="FileSaveAs" getEnabled ="rbx_SaveEnable" onAction ="rbx_SaveAction"/>
      </commands>  
    </customUI>
    
    

     The callback part is:

            public bool rbx_SaveEnable(Office.IRibbonControl control)
            {
                return true;
            }
            public void rbx_SaveAction(Office.IRibbonControl control, ref bool cancelDefault)
            {
                //your customization processor
                MessageBox.Show("Cusotm File SaveAs dialog callback");
                //set this parameter to false to enable built-in processor
                cancelDefault = false;      
            }
    

    I hope you can get some reference from this.

    Good day,


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, September 23, 2011 3:01 PM
    Moderator

All replies

  • Please provide more information about how you go about disabling and enabling the command.
    Cindy Meister, VSTO/Word MVP
    Thursday, September 22, 2011 10:35 PM
    Moderator
  • Hi et-Cliff,

    Thanks for your post.

    I'm not aware of how you custom your backstage, but here is how I custom built-in control of backstage:

    The XML part should be something like:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
      <commands >
        <command  idMso ="FileSaveAs" getEnabled ="rbx_SaveEnable" onAction ="rbx_SaveAction"/>
      </commands>  
    </customUI>
    
    

     The callback part is:

            public bool rbx_SaveEnable(Office.IRibbonControl control)
            {
                return true;
            }
            public void rbx_SaveAction(Office.IRibbonControl control, ref bool cancelDefault)
            {
                //your customization processor
                MessageBox.Show("Cusotm File SaveAs dialog callback");
                //set this parameter to false to enable built-in processor
                cancelDefault = false;      
            }
    

    I hope you can get some reference from this.

    Good day,


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, September 23, 2011 3:01 PM
    Moderator