none
C# how to hide Word StatusBar (Microsoft.Office.Interop.Word) ? RRS feed

  • Question

  • Using C# - I'm launching Word from my C# application.

    Need to hide the Word Status Bar

    Here the code I'm trying to run:

                //Set status for word application is to be visible or not.
                m_winword.Visible = true;
    
                //each opened documents are displayed in the task bar - the default Single Document Interface (SDI)
                m_winword.ShowWindowsInTaskbar = true;
    
                 //Create a missing variable for missing value
                object missing = System.Reflection.Missing.Value;
    
                //Create a new document from template
                Object oTemplatePath = GetTemplateFile();
                m_document = m_winword.Documents.Add(ref oTemplatePath, ref missing, ref missing, ref missing);         
                
                //Set the app state
                m_winword.WindowState = WdWindowState.wdWindowStateNormal;
                //hide the rulers
                m_winword.ActiveWindow.ActivePane.DisplayRulers = false;
                //hide ScrollBars
                m_winword.ActiveWindow.DisplayHorizontalScrollBar = false;
                m_winword.ActiveWindow.DisplayVerticalScrollBar = false;
    
                //hide StatusBar
                m_winword.DisplayStatusBar = false;

    The problem is when I set m_winword.DisplayStatusBar = false;

    DisplayStatusBar immediately goes back to true ?!?!?!

    Any ideas? Can I set DisplayStatusBar to false? In MSDN doc it seems that we should be able to.


    MCunha

    Thursday, May 22, 2014 3:42 PM

Answers

  • Since the Ribbon version of Office (2007) it's not possible to hide the status bar. The command is present in the object model for reasons of backwards compatibilty (so that code containing commands that refer to the status bar doesn't trigger errors).

    Make sure you're looking at the MSDN files for the version of Word you're testing against. In the one for Word 2010, for example, I see:

    "This property is no longer supported in Microsoft Word Visual Basic for Applications."


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, May 22, 2014 3:42 PM
    Moderator

All replies

  • Since the Ribbon version of Office (2007) it's not possible to hide the status bar. The command is present in the object model for reasons of backwards compatibilty (so that code containing commands that refer to the status bar doesn't trigger errors).

    Make sure you're looking at the MSDN files for the version of Word you're testing against. In the one for Word 2010, for example, I see:

    "This property is no longer supported in Microsoft Word Visual Basic for Applications."


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, May 22, 2014 3:42 PM
    Moderator
  • Cindy,

    Thank you also for the Word status bar answer.

    Just before you post your answer I moved the question to an other thread http://social.msdn.microsoft.com/Forums/en-US/8062b5c7-e17d-4db7-9bc8-d213a95b0a92/c-how-to-hide-word-statusbar-microsoftofficeinteropword-?forum=worddev


    MCunha



    • Edited by MCunha Thursday, May 22, 2014 3:49 PM typo
    Thursday, May 22, 2014 3:48 PM
  • OK, I've split my answer and merged it to the new, separate question (which was the right thing to do BTW)

    If you have a moment and are satisfied that these are the answers (even if you wish they were different <g>) could you mark them as such :-)?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, May 22, 2014 4:22 PM
    Moderator