none
Can't find commandBars in OneNote Interop DLL C# RRS feed

  • Question

  • Hello,

    I am trying to create a toggle to minimize and maximize the Ribbon in OneNote  by using the OneNote interop DLL C#.

    Is there a way to access the commandbars for OneNote as I can't seem to find it?

    The code below shows how I am able to achieve the this for Microsoft Word.

     Microsoft.Office.Interop.Word.Application wordApplication = null;

                try

                {

                    wordApplication = new Microsoft.Office.Interop.Word.Application() { Visible = true, ScreenUpdating = true };


                    Thread.Sleep(sleepTimeMS);

                    wordApplication.CommandBars.ExecuteMso("MinimizeRibbon");

                    

                          

                    wordApplication.Quit();

                    releaseCOM(wordApplication);

                    GC.Collect();

                }

                catch (Exception e)

                {

                    Console.WriteLine(e);

                }

    Any help would be  greatly appreciated 

    Thanks

    Kel

    Friday, December 7, 2018 1:45 PM

All replies

  • Hi FourthTek2,

    If you want to use OneNote interop in C#, you could use Microsoft.Office.Interop.OneNote.Application.

    For more details with examples, you could refer to the MSDN document.

    https://docs.microsoft.com/en-us/office/client-developer/onenote/window-interfaces-onenote

    https://docs.microsoft.com/en-us/office/client-developer/onenote/onenote-developer-reference

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 10, 2018 3:28 AM
  • Hi Wendy,

    I am already using Microsoft.Office.Interop.OneNote.Application but I just wanted to know if I can access commandBars for OneNote as I can't seem to find it in Microsoft.Office.Interop.OneNote.Application.

    Alternatively, is there another way to minimize and maximize the Ribbon using C# or VB in OneNote?

    Thanks


    • Edited by FourthTek2 Monday, December 10, 2018 9:55 AM
    Monday, December 10, 2018 9:55 AM
  • Hi RourthTek2,

    If you need further help for OneNote, you could post a new thread in Office FORUM.

    https://social.msdn.microsoft.com/Forums/en-US/home?category=officedev&filter=alltypes&sort=lastpostdesc

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 12, 2018 7:32 AM