none
MarkAsFinal OnAction not working RRS feed

  • Question

  • Hi,

    I'm trying to get a hook into the OnAction of MarkAsFinal but i couldn't get it working. Below is the command tag i use in the ribbon xml 

    <command idMso="FileMarkAsFinal" onAction="DocumentMarkAsFinal" />

    and below is the OnAction event method inside of my cs file.

    public void DocumentMarkAsFinal(Office.IRibbonControl control, ref bool cancelDefault)
            {
    
            }

    I have also tried with different syntax of the same method like below

    public void DocumentMarkAsFinal(Office.IRibbonControl control)
            {
    
            }
    
    public void DocumentMarkAsFinal(object control)
            {
    
            }
    
    public void DocumentMarkAsFinal()
            {
    
            }

    But nothing is working for me. That is when i press the Mark As Final button nothing happens. Meaning that i have a breakpoint in the first like of the method which is not getting hit. But i was able to hook into "FileSave" & "FileSaveAs". 

    Could someone point me where i'm getting things wrong? 



    • Edited by BigBambino Tuesday, May 17, 2016 4:42 PM
    Tuesday, May 17, 2016 4:27 PM

Answers

  • Hi BigBambino,

    As far as I am concerned, you can’t repurpose the existing definitive command button in the Backstage view by changing its onAction callback attribute. Please visit here, you can find the following information.

    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.

    >> But I was able to hook into "FileSave" & "FileSaveAs".
    FileSave and FileSaveAs are commands in excel, so you can custom them. However, FileMarkAsFinal isn’t a specific command, the onAction callback isn’t supported. i would suggest you try hide the built-in UI and rebuild it.

    Best Regards,

    Edward


    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.


    • Marked as answer by BigBambino Wednesday, May 18, 2016 11:41 AM
    Wednesday, May 18, 2016 9:11 AM

All replies

  • Hi BigBambino,

    As far as I am concerned, you can’t repurpose the existing definitive command button in the Backstage view by changing its onAction callback attribute. Please visit here, you can find the following information.

    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.

    >> But I was able to hook into "FileSave" & "FileSaveAs".
    FileSave and FileSaveAs are commands in excel, so you can custom them. However, FileMarkAsFinal isn’t a specific command, the onAction callback isn’t supported. i would suggest you try hide the built-in UI and rebuild it.

    Best Regards,

    Edward


    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.


    • Marked as answer by BigBambino Wednesday, May 18, 2016 11:41 AM
    Wednesday, May 18, 2016 9:11 AM
  • Hi Edward,

    Thank you for your response. That helped me a lot. 

    Wednesday, May 18, 2016 11:41 AM