Manage Styles, Hide Until Used

This feature of Word must be hopelessly complex (so much so that it is over my head), or flat out broken in the UI.

Today I created a new template and in that template, I created nine new styles "Legal List L1 trough Legal List L9."  I then linked those new styles to a new List Style which I named "Legal List."

After creating the new styles, all nine styles appear in the Styles Pane.  My style pane options are:

Select Styles to Show:  In current document

Select how list is sorted:  Alphabetical.

With the template open and blank (containing no text).  All of these 9 styles appear in the Styles pain regardless if the select Styles to show is set to "In current document" (which I concede they may be), or "In Use" which they certainly are not.

The same behavior occurs if I open a new blank document based on this template.

Next using the Manage Styles dialog Recommend Tab, I set styles Legal List L4-L9 to "Hide until used."  Again, no combination of settings in the various Manage Style dialog tabs resulted in L4-L9 being hidden in the styles pane until used.

Finally I ran this macro which does at least hide the L4-L9 styles until they are used.  However if say L4 is applied to a paragraph and then that paragraph is deleted L4 remains visible and I can only hide it again by rerunning the macro:

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oStyle As Style
Dim oPar As Paragraph
Dim bNotUsed As Boolean
bNotUsed = True
For Each oStyle In ActiveDocument.Styles
  If InStr(oStyle.NameLocal, "Legal List L") = 1 Then
    If Right(oStyle.NameLocal, 1) > 3 Then
      For Each oPar In ActiveDocument.Paragraphs
        If oPar.Style = oStyle Then
          bNotUsed = False
          Exit For
        End If
      Next
      If bNotUsed Then
        oStyle.Visibility = True
        oStyle.UnhideWhenUsed = True
      End If
    End If
  End If
Next
End Sub

Is it supposed to be this hard?  Is there nothing in the Manage Style UI dialogs that can be used to "hide" a style until it is actually used and if it is no longer being used then hide it again?

Thanks.

 

My experience has been that once a style is used in a document it is in the list of styles in use even if there is no longer any text (including empty paragraph marks) in which the style is actually applied.

Because my personal options are to display all styles, I do not have a lot of experience with this.

Volunteering to "pay forward" the help I've received in the Microsoft user community.


Charles Kenyon
Sun Prairie, Wisconsin
wordfaq[at]addbalance[dot]com

Legal site: https://addbalance.com

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Charles,

I think I agree that once used means used (never unused).  However, while the 9 styles were created in the template, they were never really used there and certainly never used in new blank documents based on the template.  It seems to me that the simple dialog settings should suppress the display of any style marked "Hide until used" until it is actually used for the first time in a document.

I think it is broke plain and simple :-(

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I would agree that it is broken. The fact that the vba setting to HIDE a style is '.Visibility = True' should be a good indicator that Microsoft's developers haven't paid enough attention to this area over the years.

I assume that the hide until used setting relies on the .InUse property which sounds right in theory but as you know, is similarly misnamed.

I also assume that only built-in styles can possibly have an .InUse setting of False. If you have created the style then I would guess that Microsoft's .InUse is always going to be True on that style. Since .InUse is a read-only setting you are probably stuck with the kludgy macro approach to shorten your displayed style list.

Andrew Lockton
Melbourne Australia

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 1,328 Applies to: