

- NO HEADING 3 SHOWS UP IN STYLES WORD FOR MAC 2011 MANUAL
- NO HEADING 3 SHOWS UP IN STYLES WORD FOR MAC 2011 CODE
- NO HEADING 3 SHOWS UP IN STYLES WORD FOR MAC 2011 FREE
The good news: the macro seems to head in the right direction. I've begun to suspect it might have to do with a broken style in the document, and after a little searching I found this DeleteUnusedStyles macro.
NO HEADING 3 SHOWS UP IN STYLES WORD FOR MAC 2011 FREE
Word cannot display the requested font." In fact there are gigabytes of free main memory and hundreds of gigabytes of free disk space. Recently I've been hitting a strange Word 2016 bug that with some documents on some workstations results in the Word error message "There is insufficient memory or disk space. I've found them very helpful over the years. If StyleInUseInRangeText(, Styname) Then StyleInUse = True: Exit Function ' Heuristically, is the specified story in actual use?Ĭase Else: Debug.Assert False ' Must be some new or unknown wdStoryType ' Is any of "rng" formatted as "styname"? I note the Greg Maxey method of searching all stories is a good starting point, but I think it has two problems : 1) it doesn't check text associated with shapes, and 2) it will pick up "orphaned text" that is stories that are not in use, e.g., in a first-page-footer in a section that doesn't have the different-first-page-footer setting set. I thought people might be interested in some functions I use in my own "DeleteUnusedStyles" implementation. ' Is any of ActiveDocument's text formatted as "Styname"?
NO HEADING 3 SHOWS UP IN STYLES WORD FOR MAC 2011 CODE
Also, the current code will raise an error with some types of shapes. To check all shapes in the document you need to put the shape test coding inside the Stry loop. The ActiveDocument.Shapes statement only gives shapes in the body. Overcomes the need to have complex VBA code and fixes the issue of nested story ranges and unused story.

NO HEADING 3 SHOWS UP IN STYLES WORD FOR MAC 2011 MANUAL
While it would be too tedious to use manual F&R for each custom style, a quick and dirty method would be to use a small macro to delete all custom styles that don’t have their InUse flag set then use manual F&R to test the remainder, not bothering to test styles that are obviously used. If Not Stry.StoryLength > 1 Then StoryInUse = False: Exit FunctionĬase wdMainTextStory, wdPrimaryFooterStory, wdPrimaryHeaderStory: StoryInUse = TrueĬase wdEvenPagesFooterStory, wdEvenPagesHeaderStory: StoryInUse = Stry.Sections(1).PageSetup.OddAndEvenPagesHeaderFooter = TrueĬase wdFirstPageFooterStory, wdFirstPageHeaderStory: StoryInUse = Stry.Sections(1).PageSetup.DifferentFirstPageHeaderFooter = TrueĬase wdFootnotesStory, wdFootnoteContinuationSeparatorStory: StoryInUse = > 1Ĭase wdFootnoteSeparatorStory, wdFootnoteContinuationNoticeStory: StoryInUse = > 1Ĭase wdEndnotesStory, wdEndnoteContinuationSeparatorStory: StoryInUse = > 1Ĭase wdEndnoteSeparatorStory, wdEndnoteContinuationNoticeStory: StoryInUse = > 1Ĭase wdCommentsStory: StoryInUse = > 1Ĭase wdTextFrameStory: StoryInUse = > 1Ĭase Else: StoryInUse = False ' Must be some new or unknown wdStoryTypeįind in VBA only searches the current story whereas manual Find & Replace searches the whole document. ' Note: this will mark even the always-existing stories as not in use if they're empty ' Returns True if "Styname" is use in rngįunction StoryInUse(Stry As Range) As Boolean StyleInUse = False ' Not currently in use.įunction StyleInUseInRangeText(rng As Range, Styname As String) As Boolean If StyleInUseInRangeText(txtFrame.TextRange, Styname) Then StyleInUse = True: Exit Function If StyleInUseInRangeText(Stry, Styname) Then StyleInUse = True: Exit Function If Not ActiveDocument.Styles(Styname).InUse Then StyleInUse = False: Exit Functionįor Each Stry In ActiveDocument.StoryRanges ' Is Stryname used any of ActiveDocument's story Name:=oStyle.NameLocal, Object:=wdOrganizerObjectStylesįunction StyleInUse(Styname As String) As Boolean If StyleInUse(oStyle.NameLocal) = False ThenĪpplication.OrganizerDelete Source:=ActiveDocument.FullName, _ Even if the built-in style is no longer used, but was once used in the document, it will still show up in the styles drop-down list. In fact, Word doesn't allow built-in styles to be deleted from a document. This is because deleting a built-in style doesn't really delete it, but only resets that style to its original, default condition.

Note that the macro ignores a style if it is a built-in style. The following macro, DeleteUnusedStyles, does just that. If it isn't, then the style can be easily deleted. It can quickly search through a document to see if a particular style is used anywhere. You may want to get rid of these styles, but this can be dangerous to the format of your document if you start deleting them without knowing that they really are not in use.

When you work with a document for a long time, or when you inherit a document from someone else, it is very possible that it contains styles that are no longer in use.
