locked
Hide backstage button RRS feed

  • Question

  • Hi to all,

    there is any way to hide the built-in backstage button ("File") ?

    Thanks for any help.

    Thursday, July 15, 2010 2:08 PM

Answers

  • Hi Fabrizio,

    My last reply aimed at hiding the tab created by user. Here is the method to hide the Office tab. I've made a lot of research
    on this topic,Unfortunately, as far as I see, there is no method exposed by Object Model to hide the File Tab of Office while
    other ones can be hidden such as Home Tab, Insert Tab etc. However, we can disable the buttons in the File Tab.
    Relative code in .xml File:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
     <commands>
     <command idMso="ApplicationOptionsDialog" enabled="false"/>
     <command idMso="FileExit" enabled="false"/>
     <command idMso="FileSave" enabled="false"/>
     <command idMso="FileSaveAs" enabled="false"/>
     <command idMso="FileOpen" enabled="false"/>
     <command idMso="FileClose" enabled="false"/>
     </commands>
     <ribbon startFromScratch="true">
      <tabs >
      <tab idMso="TabHome" visible="true" >
      </tab>
      <tab idMso="TabInsert" visible="true">
      </tab>
     </tabs>
     </ribbon>
    </customUI>
    
    

    Please check to see if it can satisfy your needs. Furthermore, you can download the Office2010 ControlID from the link:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en
    I think it's helpful in Office Ribbon programming. Thank you!

    Best Regards,
    Amy Li

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, July 22, 2010 6:55 AM

All replies

  • Hi Fabrizio,


    Could you please describe your needs in details such as tell me the version of the develop tools? Is it targeting the VS2010?
    Does “File” mean the File tab in Office 2010 UI? May be I could offer more help.
    Furthermore, here is a link for: Possible to hide built-in ribbon elements
    http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/cf0f5dc2-3ef9-41c6-8bd1-167d7ef5b9dd
    Please check it to see if it's related to your topic.  I'm looking forward to your reply, thank you!

    Best Regards,
    Amy Li


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, July 20, 2010 9:36 AM
  • Hi Amy Li,

    I'm using Visual Studio 2010 and I would to hide the File Tab in Office 2010 (Word, Excel and PowerPoint).

    Thanks.

    Tuesday, July 20, 2010 4:33 PM
  • Hi Fabrizio,

    After reading your question, I've written a program for you and it can hide the tab through the button click event. Please check to see if it
    satisfy your needs.(My develop environment targeting VS2010 and Office2010,Excel 2010 etc)
     The procedure of creation is:
    1. Start the VS2010, Choose File->New->Project->Excel2010 Workbook
    2. Create a custom tab:
    (1) On the Project menu, click Add New Item.
    (2) In the Add New Item dialog box, select Ribbon (Visual Designer).
    (3) Change the name of the new Ribbon to MyRibbon, and click Add.
    The MyRibbon.cs or MyRibbon.vb file opens in the Ribbon Designer and displays a default tab and group.
    (4) In the Ribbon Designer, click group1.
    (5) In the Properties window, set Label to "Hide the File Tab"
    (6) From the Office Ribbon Controls tab of the Toolbox, drag a button onto group1.
    (7) Click button1 to select it.
    (8) In the Properties window, set Label to  "Hide Tab button"
    (9) Select the Ribbon1 Control, in the Properties window, choose the Tabs  and Add a new Tab to the Ribbon1.
    (10) Double click the "Hide Tab button" button to create the button_click event.
    (11) Add the code in the button1_Click method:    
    tab2.Visible = false;

    Then run the program, you will see two built-in tabs created in the Excel, one is MyRibbon tab, another is tab2. Then click the button "Hide Tab button" in MyRibbon tab, the tab named "tab2" is hidden.
    Furthermore, here are links in details for this topic:
    Display and Hide Tabs, Groups, and Controls on the Microsoft Office Ribbon (Part 1 of 2)
    http://msdn.microsoft.com/en-us/library/ee390805(office.11).aspx
    Display and Hide Tabs, Groups, and Controls on the Microsoft Office Ribbon (Part 2 of 2)
    http://msdn.microsoft.com/en-us/library/ee633442(v=office.11).aspx

    Walkthrough: Creating a Custom Tab by Using the Ribbon Designer
    http://msdn.microsoft.com/en-us/library/bb386104.aspx
    I hope they will be helpful. If you have any further question or if I misunderstood you, please feel free to contact. Thank you!


    Best Regards,
    Amy Li

    Wednesday, July 21, 2010 8:28 AM
  • Hi Fabrizio,

    My last reply aimed at hiding the tab created by user. Here is the method to hide the Office tab. I've made a lot of research
    on this topic,Unfortunately, as far as I see, there is no method exposed by Object Model to hide the File Tab of Office while
    other ones can be hidden such as Home Tab, Insert Tab etc. However, we can disable the buttons in the File Tab.
    Relative code in .xml File:

    <?xml version="1.0" encoding="UTF-8"?>
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
     <commands>
     <command idMso="ApplicationOptionsDialog" enabled="false"/>
     <command idMso="FileExit" enabled="false"/>
     <command idMso="FileSave" enabled="false"/>
     <command idMso="FileSaveAs" enabled="false"/>
     <command idMso="FileOpen" enabled="false"/>
     <command idMso="FileClose" enabled="false"/>
     </commands>
     <ribbon startFromScratch="true">
      <tabs >
      <tab idMso="TabHome" visible="true" >
      </tab>
      <tab idMso="TabInsert" visible="true">
      </tab>
     </tabs>
     </ribbon>
    </customUI>
    
    

    Please check to see if it can satisfy your needs. Furthermore, you can download the Office2010 ControlID from the link:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=3f2fe784-610e-4bf1-8143-41e481993ac6&displaylang=en
    I think it's helpful in Office Ribbon programming. Thank you!

    Best Regards,
    Amy Li

     


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, July 22, 2010 6:55 AM
  • Many thanks.
    Thursday, July 22, 2010 9:38 AM
  • <command idMso="FileSaveAs" enabled="false"/>

    not working in word 2013. please guide.

    Tuesday, October 15, 2013 11:29 AM
  • Hi, did you ever get this working?
    Thursday, October 16, 2014 1:44 PM