none
how to disable left/up menu on word2007 RRS feed

  • Question

  • You cannot vote on your own post
    0

    Hi

    I open an word file as read only by winForm to disable the left/up menu succesfully.

    and then to run the printview ,i create new Word.ApplicationClass() for printview.

    Problem has occurred when i run the printview.

    Problem:the left/up menu can not be disabled.

    certainly i try to get CommandBars by GetType().InvokeMember, and set the

    enable of CommandBarControl to false.

     I'll be very grateful for any help. 

    Wednesday, December 15, 2010 1:19 AM

Answers

  • Hi Livio

    See the parallel discussion in this message thread (my response)

    http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/0e9928c5-afea-4737-b0f6-acff3a9c4761

    Basically, you can't do it and it's by design.

    What this means for your applicaiton, that's a WinForms application, is that you have much less control and fewer possibilities for automating the Office application user interface. A conscious decision was made to only support that for things running in-process with the application (documents or add-ins).

    It will not be possible for you to disable the Save command using your application, as it currently stands. The best you can do is to work with the DocumentBeforeSave event. But you can't disable the Save button or the Save command using only a WinForms application.


    Cindy Meister, VSTO/Word MVP
    Thursday, December 16, 2010 7:50 AM
    Moderator

All replies

  • Hi Livio

    Which control do you mean "the left/up menu"? The Office button (the big round, colorful one)? Something else?

    Word 2007 no longer uses the CommandBars object model to work with menus. It uses the Ribbon, and it's an entirely different thing to work with. Disabling controls can only be done via Ribbon XML ("Office Fluent UI") and the Ribbon XML must be part of a document or of an Add-in. A WinForm application cannot influence the Ribbon.

    In addition, some commands cannot be disabled or hidden (the Office button being one of them). This is by design.


    Cindy Meister, VSTO/Word MVP
    Wednesday, December 15, 2010 1:50 PM
    Moderator
  • Hi Cindy Meister

    Thank you for your quick response!

    >Which control do you mean "the left/up menu"? The Office button (the big round, colorful one)? Something else?

    Yes.i meaned the Office button (the big round, colorful one).

    when I load the 2007 word into winform. The button can be hidden by do nothing.

    but when i try to new the word and open it, the Office button displayed again.

    My goal is to disable the save function,so i want to hidden the Office button.

    Do you have any solution for the goal.

    Thank you vary much.

    PS:

    Now I is searching the GPO which can do it likely.

    ↓this is the site now i 'm concerinng on.

    http://www.add-in-express.com/forum/read.php?FID=5&TID=6464

    livio

     

    Thursday, December 16, 2010 1:53 AM
  • Hi Livio

    See the parallel discussion in this message thread (my response)

    http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/0e9928c5-afea-4737-b0f6-acff3a9c4761

    Basically, you can't do it and it's by design.

    What this means for your applicaiton, that's a WinForms application, is that you have much less control and fewer possibilities for automating the Office application user interface. A conscious decision was made to only support that for things running in-process with the application (documents or add-ins).

    It will not be possible for you to disable the Save command using your application, as it currently stands. The best you can do is to work with the DocumentBeforeSave event. But you can't disable the Save button or the Save command using only a WinForms application.


    Cindy Meister, VSTO/Word MVP
    Thursday, December 16, 2010 7:50 AM
    Moderator
  • hi Cindy Meister

    Thank you for your answer!

    I get it. Now I will try to change my project design to walk around.

    Livio

    Thursday, December 16, 2010 8:02 AM