0

[In Office 2007+, you can cause the ribbon to be minimized so that only the tab names are shown, which makes it look a bit like a menu bar. The full ribbon is then only shown when you click on a tab. This ribbon state is what I'm trying to control.]

In the Word 2007+ object model, there's a ToggleRibbon method on the Window object, that minimizes (or not) the ribbon for that window.

I'm looking for an equivalent method in PowerPoint 2007+, and I can't find one. Is there such a thing, and if not is there another way to achieve it? Apart from using SendKeys, that is - don't go there.

Gary McGill
  • 26,400
  • 25
  • 118
  • 202

1 Answers1

-1

i have implemented in c# with word addins .

you can take help from below link:
http://msdn.microsoft.com/en-us/library/bb608590.aspx

I have added a button in the ribbon(visual).
in the button click, i have added following code.

 private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            Globals.ThisAddIn.Toogle();
        }

i have added these code in the ThisAddIn.cs:

 public void Toogle()
        {
            Word.Window obj = Application.ActiveWindow;
            obj.ToggleRibbon();
        }

sorry, Window.ToggleRibbon() is present only in word. even it is not present in excel or work. so achieve this, do the following code :

 private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            SendKeys.SendWait("^{F1}");
        }

Hope , this will work for you.

Mohammad Arshad Alam
  • 9,694
  • 6
  • 38
  • 61
  • Thanks, but I think you mis-understood the question. I'm not trying to show/hide a task pane - I'm trying to minimize or restore the ribbon. I'll update the question to make this clearer. – Gary McGill Oct 18 '12 at 14:10
  • you can change height of the user control in the toggle button click http://msdn.microsoft.com/en-us/library/microsoft.office.tools.customtaskpane.height.aspx – Mohammad Arshad Alam Oct 18 '12 at 14:35
  • You're not listening :-) This is not about task panes. This is about the ribbon. You know, the big thing at the top of the window with buttons on it. – Gary McGill Oct 18 '12 at 15:08
  • do you mean to minimize and maximize power point using button in the ribbon ? – Mohammad Arshad Alam Oct 19 '12 at 08:04
  • No! This: http://office.microsoft.com/en-us/word-help/minimize-the-ribbon-HA010166329.aspx – Gary McGill Oct 19 '12 at 10:12
  • I don't want to minimize/maximize the application window, I want to minimize/maximize the RIBBON. Please see the link in my comment above that explains what this means, and how to do this through the UI. – Gary McGill Oct 19 '12 at 12:52
  • hope , i have understood the requirement and updated the code ;-) – Mohammad Arshad Alam Oct 19 '12 at 13:43
  • Thanks for all your effort, but if you had read the question, you would see that I know all about ToggleRibbon in Word. This method is not available in PowerPoint - which is why I posted this question. – Gary McGill Oct 19 '12 at 14:04
  • the only way to achieve your requirement. – Mohammad Arshad Alam Oct 19 '12 at 14:21