none
Any Way to Get View::ShowParagraphs View::ShowSpaces View::ShowAll From a Dialog Box??? RRS feed

  • Question

  • Hi everyone!

    My program has a need to get, from the View object, the ShowParagraphs, ShowSpaces, ShowTabs and ShowAll properties.  Unfortunately, they cause the screen to flash in Word 2007 if there's a list (bulleted or numbered) or Table Of Contents visible on the screen.  I have avoided screen flashing in other circumstances by using the Dialog object to obtain various properties.  However, I cannot find in the documentation, any item in the enumeration WdWordDialog that contains these (ShowParagraphs etc) properties.  However, they are contained in the Word Options dialog box under the Display catagory.  Does anyone know how I would access this dialog box?   

    If anyone has any great suggestions on this, I'd sure appreciate if you'd reply to this question....


    Fred
    Tuesday, May 24, 2011 12:36 PM

Answers

  • Hi Fred

    Dialogs(wdDialogToolsOptionsView)


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by FEINSTEI Thursday, May 26, 2011 12:17 PM
    Thursday, May 26, 2011 10:54 AM
    Moderator

All replies

  • My program has a need to get, from the View object, the ShowParagraphs, ShowSpaces, ShowTabs and ShowAll properties. Unfortunately, they cause the screen to flash in Word 2007 if there's a list (bulleted or numbered) or Table Of Contents visible on the screen. I have avoided screen flashing in other circumstances by using the Dialog object to obtain various properties. However, I cannot find in the documentation, any item in the enumeration WdWordDialog that contains these (ShowParagraphs etc) properties. However, they are contained in the Word Options dialog box under the Display catagory. Does anyone know how I would access this dialog box?

    If you want to access a dialog which only contains “ShowAll”, “ShowParagraphs”, “ShowSpace” …and the other this kinds of item, you will need to custom a dialog box. Please see this document about how to create a custom dialog box.

     

    Actually, the WdWordDialog Enumeration is a collection of dialogs that we can access via UI. The Enumeration doesn’t contain custom dialog.

     

    As we can change “ShowAll”, “ShowParagraphs” and “ShowSpace” this kinds of properties’ value in

    BackStage -> Option -> Display dialog, we can open this dialog through the C# code below:

     

    this.Application.Dialogs[Word.WdWordDialog.wdDialogToolsOptionsView].Show();

     

    In additionally, you can directly assign the value of these properties using C# code:

     

                this.ActiveWindow.View.ShowSpaces = true;

                this.ActiveWindow.View.ShowParagraphs = true;

                this.ActiveWindow.View.ShowAll = true;

     

    For more information:

    View.ShowAll Property (Word)

    View.ShowSpaces Property (Word)

    View.ShowParagraphs Property (Word)

     

    I hope this helps.


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 26, 2011 8:55 AM
    Moderator
  • Hi Fred

    Dialogs(wdDialogToolsOptionsView)


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by FEINSTEI Thursday, May 26, 2011 12:17 PM
    Thursday, May 26, 2011 10:54 AM
    Moderator
  • Thanks so much Cindy!  The documentation didn't have any properties listed for this enumeration. 

    As usual, you have the right answer.  Microsoft would do well to hire you as an expert on MS-Office! 


    Fred
    Thursday, May 26, 2011 12:17 PM
  • Wrong answer Cal.  Read the question!
    Fred
    Thursday, May 26, 2011 12:21 PM
  • Hi Fred,

    Maybe I have misunderstood something about your question. However, I have told you that you can access the dialog using

     

     this.Application.Dialogs[Word.WdWordDialog.wdDialogToolsOptionsView].Show();
    

     

    I think you haven't read my reply carefully.

     


    Best Regards, Calvin Gao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Thursday, May 26, 2011 12:25 PM
    Moderator
  • Hi Fred

    <<The documentation didn't have any properties listed for this enumeration. >>

    Actually, I do find it in the list of "Built-in dialog arguments" (my search term in the object model help - VBA). That's where you want to look for what you might be able to get. (I use "might" because the dialogs aren't really updated to expose these things any more and YMMV)


    Cindy Meister, VSTO/Word MVP
    Thursday, May 26, 2011 1:17 PM
    Moderator
  • Hi Cindy,

      Thanks for pointing this out.  Since I'm a "C" language coder, I use the MSDN documentation for Office 2007, which is sadly neglected by the Word documentation group and is quite out of date and inaccurate.    I'll start to use the VBA help stuff in the future thanks to your suggestion.  Again, you've been of immeasurable help in helping me get around the inexcusable bugs in the Word Automation Interface and I really appreciate it!  The idea of using dialog boxes to get around the screen flashing has made my code run at least 5 times faster!

    With gratitude,

    Fred E.

    Midwest USA


    Fred
    Thursday, May 26, 2011 1:59 PM