locked
Grid Styles in StyleGalleryClassic, How to Remove RRS feed

  • Question

  • Tried this same post in the dev center but with no luck. MSDN Community Support guy Terry suggested I try here.

    I have a custom template with a custom ribbon containing the StyleGalleryClassic XML element.

    I've used the style manager to show only the styles I want used in the documents being created with this template and the StyleGalleryClassic list that's on the ribbon looks like the list of styles that shows in the styles window, EXCEPT for those annoying grid styles (Colorful Grid, Colorful Grid - Accent 1, Colorful Grid - Accent 2 and so on) showing up in the StyleGalleryClassic list.

    When I select them in Manage Styles the "Hide" button is grayed out so I'm not able to hide them as I did other styles. I've also tried making them Restricted but they still show in the StyleGalleryClassic list. I've also tried deleting those styles but they don't delete.

    Is there anyway to hide or delete all those grid styles. Or, is there another simple styles list like the StyleGalleryClassic that I can put on the ribbon?

    This screen cap shows the difference between the StyleGalleryClassic and the styles window.

    Thanks for reading,
    Ken

    Tuesday, July 3, 2018 12:34 PM

All replies

  • Hi Ken,

    >>When I select them in Manage Styles the "Hide" button is grayed out so I'm not able to hide them as I did other styles. I've also tried making them Restricted but they still show in the StyleGalleryClassic list. I've also tried deleting those styles but they don't delete.

    Would you mind to share the detailed steps about this part? I would like to follow you to do further test in my side.

    Based on the screenshot you shared above, the style lists for Colorful Grid, Colorful Grid - Accent 1, Colorful Grid - Accent 2 are all Table styles. Generally, we can use the Restrict Formatting in Word to set the Permit and Restrict styles or formatting in Word:

    Please follow the article below to set the Permit formatting for current document:
    https://support.office.com/en-us/article/restrict-or-permit-formatting-changes-69ca7857-db43-4785-9e14-7735db6d79bb


    Best Regards,
    Winnie Liang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Wednesday, July 4, 2018 9:10 AM
  • Click Review | Restrict Editing and try the "Limit formatting to a selection of styles" option in the Restrict Editing pane.You should be able to hide all table styles after clicking Settings. When you are done, don't forget to click Yes, Start Enforcing Protection.

    Note that what you are calling "grid styles" are really called table styles in Word.


    Stefan Blom, Microsoft Word MVP


    Thursday, July 5, 2018 12:02 AM
  • Thanks for the suggestions all, much appreciated.

    When using the Manage Styles and the Limit Formatting..." check box on that dialog as suggested by Winnie Liang it also grays out the font change options on the ribbon (Bold, Italic) as well as the paragraph alignment options. We do want to limit what styles are showing but need those other formatting options.

    When using the Review tab and the "Limit formatting..." as suggested by Stefan Blom the darn table styles still show in the StyleGalleryClassic menu.

    Any other suggestions are more than welcome.

    Thanks again,
    Ken

    Sunday, July 15, 2018 3:38 PM
  • After you have enforced the protection, most options should be unavailable.

    I must say that I'm not surprised that the classic Styles drop down remains unaffected by the restrictions. :-(


    Stefan Blom, Microsoft Word MV


    Sunday, July 15, 2018 7:43 PM
  • As I mentioned earlier the styles window is showing only the styles we want, but the StyleGalleryClassic menu is showing the table styles as well.

    Does this mean there is no other way to get the StyleGalleryClassic to NOT show the table styles and to have it list only the styles showing in the styles window?

    Sunday, July 15, 2018 7:50 PM
  • Realized we have another template using the StyleGalleryClassic but it is NOT showing the table styles. Going to try and compare the two, will report back if I find anything.
    Thursday, July 19, 2018 12:07 PM
  • As far as I can remember, the only article that deals with hiding table styles is the following:

    https://shaunakelly.com/word/styles/how-to-hide-table-styles-in-word.html

    However, the article describes how to use VBA to hide table styles from the Table gallery. I haven't tested if it applies to the Styles drop down as well.


    Stefan Blom, Microsoft Word MVP


    Thursday, July 19, 2018 1:33 PM

  • We have some template that when the StyleGalleryClassic is added the table grid styles show, others don't.

    It MIGHT be that the ones in which they DON'T show were created from existing .dot 2003 template files.

    I'm still trying to confirm that but does that mean anything to anyone?

    Thanks again,
    Ken

    Sunday, July 22, 2018 9:05 PM
  • The having been picked up from an existing .dot file thing doesn't seem to be a factor. I think one of the templates that shows the table grid styles in the StyleGalleryClassic WAS created up from a .dot file.

    The page Stefan suggested showed how to hide them with VBA code so I wrote/ran this little on the template file and it seems to have made them not show in the StyleGalleryClassic menu.

        Dim Sty As Word.Style, Fnd$
        For Each Sty In ActiveDocument.Styles
            If Sty.Type = wdStyleTypeTable Then
                With Sty
                    Fnd$ = Fnd$ & Sty.NameLocal & vbCrLf
                    .Visibility = True
                    .UnhideWhenUsed = True
                End With
            End If
        Next Sty
        Documents.Add
        Selection.TypeText Fnd$

    Decided to keep .UnhideWhenUsed True so that (as the page mentions) the user can see what is making the formatting if something is cut and pasted.

    So now my question is why the heck does setting the .Visibility to TRUE hide them and setting it to FALSE show them!? I've written a fair amount of VBA code over the years and this just seems counter intuitive. 

    I'm beginning to think I'm loosing it. :o)

    So, I've solved the immediate problem but still don't have any idea why the StyleGalleryClassic matches the styles window in some templates but not others.

    Oy.

    Thanks,
    Ken


    • Edited by KenKrugh Monday, July 23, 2018 1:09 PM mispelling
    Monday, July 23, 2018 1:07 PM
  • Thanks for the follow-up.

    Note that it is documented in Shauna Kelly's article that the Visibility property is incorrect, meaning that "true" requires that you set the value "false" and vice versa.


    Stefan Blom, Microsoft Word MVP

    Wednesday, July 25, 2018 12:51 PM