none
Control "Hide until Used" style attribute programmatically RRS feed

  • Question

  • I turn on the Styles pane in Word 2010 in VBA in the AutoOpen & AutoNew modules since I can control the styles better.  I want certain styles to appear "Hide until used."  I have found that many styles (for example, Heading styles) appear in the pane, even when they have NOT been applied.  Is there a way to set the attributes for styles back to "unused" when a new file is created? 

    If styles are copied from another document into the active document, it appears to set the attribute to "used" even though it has NOT been applied.  Is there a way to combat this?

    Thank you.

    Thursday, February 21, 2013 4:00 PM

Answers

  • Have you tried the Visibility property to permanently hide styles? There is an example here with table styles (but it should work the same for paragraph and character styles): http://www.shaunakelly.com/word/styles/how-to-hide-table-styles-in-word.html.
     
    On the other hand, you'll probably find it more useful to set up a document or template with formatting restrictions (the first option, "Restrict formatting to a selection of styles," in the Restrict Formatting and Editing task pane).

    Stefan Blom, Microsoft Word MVP
    Thursday, February 21, 2013 7:17 PM