nomadmethod.blogg.se

Clear all formatting word 2016
Clear all formatting word 2016





clear all formatting word 2016

' 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

clear all formatting word 2016

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

clear all formatting word 2016

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.







Clear all formatting word 2016