Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Removing styles
I understand that once a style has been used in a Word document (or template)
it will remain in the 'Styles in use' list even though no text is formatted with this style. Is there anyway of removing such styles from the list to prevent their normal use? |
#2
|
|||
|
|||
Hi Jeff-
You don't mention a version, and I can only comment on XP(2002) right now, but I believe 2003 works the same. Also I assume you refer to the 'Show:' list at the bottom of the Task Pane which actually refers to Formatting in Use. If I select what has a style applied to it and click 'Clear Formatting' on the Task Pane, that style is removed from the list immediately. The same is true if I apply a different style to the paragraph. (Both instances as long as the style is not applied elsewhere in the doc.) Once applied the style _will_ continue to appear in the Available Formatting & the Available Styles list even if it is no longer used anywhere in the doc. Is this not how it is for you? |:) "Geoff O" wrote: I understand that once a style has been used in a Word document (or template) it will remain in the 'Styles in use' list even though no text is formatted with this style. Is there anyway of removing such styles from the list to prevent their normal use? |
#3
|
|||
|
|||
In the Format Style dialog (accessible using the Styles... button at the
bottom of the Format Settings dialog in Word 2002/2003), when you display "Styles in use," you can delete (most) unused styles. User-defined styles are actually deleted; Word's built-in styles (except for headings, Normal, and Default Paragraph Font) are removed from the list and reset to their Normal.dot default definition. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Geoff O" Geoff wrote in message ... I understand that once a style has been used in a Word document (or template) it will remain in the 'Styles in use' list even though no text is formatted with this style. Is there anyway of removing such styles from the list to prevent their normal use? |
#4
|
|||
|
|||
|
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Removing styles
Klaus: I could kiss you!
|
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Removing styles
Regards, Klaus Sub DeleteUnusedStyles() Dim myStyle As Style For Each myStyle In ActiveDocument.Styles If myStyle.InUse Then Select Case myStyle Case ActiveDocument.Styles(wdStyleDefaultParagraphFont) Case ActiveDocument.Styles(wdStyleNormal) Case ActiveDocument.Styles(wdStyleNormalTable) Case ActiveDocument.Styles(wdStyleHeading1) To _ ActiveDocument.Styles(wdStyleHeading9) Case Else Selection.Collapse (wdCollapseStart) With Selection.Find .ClearFormatting .Style = myStyle .Forward = True .Wrap = wdFindContinue .Execute FindText:="", Format:=True If .Found = False Then StatusBar = myStyle.NameLocal If MsgBox("Delete?", vbYesNo, myStyle.NameLocal) = vbYes Then myStyle.Delete End If Else If MsgBox("Keep?", vbYesNo, myStyle.NameLocal) = vbNo Then myStyle.Delete End If ' End End If End With End Select End If Next myStyle End Sub Hi Klaus: Thank you for this, but mine crashed... it never addressed the style I was trying to get rid of (I have a reoccurring problem with certain styles popping up (usually a font/indent oddity created by someone else) and I'm unable to erase them). It crashed at teh 'no list' style and gave me a run-time '4198' error. When I click debug, it highlights the myStyle.Delete line of code. I usually select all instances of the offending Word-created style and just hit delete, but once in a while, there are these buggy ones that linger and they drive me crazy. I try to select them, and nothing selects. I try to delete the style and nothing happens. I'm wondering if anyone knows another way? My offenders a 10 pt, Befo 0 pt; 10 pt, Bold, left: .83" space before 0 pt and their bold brethren. I've scoured these groups to try to solve this, and it is driving me batty. Any help would be great! |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Removing styles
I don't know if thiw will help but it is a super-charged version of
Klaus posting that he helped me put together a year or so ago: http://gregmaxey.mvps.org/Style_Report.htm On Mar 14, 11:38 am, thedr9wningman wrote: Regards, Klaus Sub DeleteUnusedStyles() Dim myStyle As Style For Each myStyle In ActiveDocument.Styles If myStyle.InUse Then Select Case myStyle Case ActiveDocument.Styles(wdStyleDefaultParagraphFont) Case ActiveDocument.Styles(wdStyleNormal) Case ActiveDocument.Styles(wdStyleNormalTable) Case ActiveDocument.Styles(wdStyleHeading1) To _ ActiveDocument.Styles(wdStyleHeading9) Case Else Selection.Collapse (wdCollapseStart) With Selection.Find .ClearFormatting .Style = myStyle .Forward = True .Wrap = wdFindContinue .Execute FindText:="", Format:=True If .Found = False Then StatusBar = myStyle.NameLocal If MsgBox("Delete?", vbYesNo, myStyle.NameLocal) = vbYes Then myStyle.Delete End If Else If MsgBox("Keep?", vbYesNo, myStyle.NameLocal) = vbNo Then myStyle.Delete End If ' End End If End With End Select End If Next myStyle End Sub Hi Klaus: Thank you for this, but mine crashed... it never addressed the style I was trying to get rid of (I have a reoccurring problem with certain styles popping up (usually a font/indent oddity created by someone else) and I'm unable to erase them). It crashed at teh 'no list' style and gave me a run-time '4198' error. When I click debug, it highlights the myStyle.Delete line of code. I usually select all instances of the offending Word-created style and just hit delete, but once in a while, there are these buggy ones that linger and they drive me crazy. I try to select them, and nothing selects. I try to delete the style and nothing happens. I'm wondering if anyone knows another way? My offenders a 10 pt, Befo 0 pt; 10 pt, Bold, left: .83" space before 0 pt and their bold brethren. I've scoured these groups to try to solve this, and it is driving me batty. Any help would be great!- Hide quoted text - - Show quoted text - |
#8
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Removing styles
I love the tool, guys, but the darn 10pt style is still in there. I can't
delete it. What does it take? "Greg Maxey" wrote: I don't know if thiw will help but it is a super-charged version of Klaus posting that he helped me put together a year or so ago: http://gregmaxey.mvps.org/Style_Report.htm On Mar 14, 11:38 am, thedr9wningman wrote: Regards, Klaus Sub DeleteUnusedStyles() Dim myStyle As Style For Each myStyle In ActiveDocument.Styles If myStyle.InUse Then Select Case myStyle Case ActiveDocument.Styles(wdStyleDefaultParagraphFont) Case ActiveDocument.Styles(wdStyleNormal) Case ActiveDocument.Styles(wdStyleNormalTable) Case ActiveDocument.Styles(wdStyleHeading1) To _ ActiveDocument.Styles(wdStyleHeading9) Case Else Selection.Collapse (wdCollapseStart) With Selection.Find .ClearFormatting .Style = myStyle .Forward = True .Wrap = wdFindContinue .Execute FindText:="", Format:=True If .Found = False Then StatusBar = myStyle.NameLocal If MsgBox("Delete?", vbYesNo, myStyle.NameLocal) = vbYes Then myStyle.Delete End If Else If MsgBox("Keep?", vbYesNo, myStyle.NameLocal) = vbNo Then myStyle.Delete End If ' End End If End With End Select End If Next myStyle End Sub Hi Klaus: Thank you for this, but mine crashed... it never addressed the style I was trying to get rid of (I have a reoccurring problem with certain styles popping up (usually a font/indent oddity created by someone else) and I'm unable to erase them). It crashed at teh 'no list' style and gave me a run-time '4198' error. When I click debug, it highlights the myStyle.Delete line of code. I usually select all instances of the offending Word-created style and just hit delete, but once in a while, there are these buggy ones that linger and they drive me crazy. I try to select them, and nothing selects. I try to delete the style and nothing happens. I'm wondering if anyone knows another way? My offenders a 10 pt, Befo 0 pt; 10 pt, Bold, left: .83" space before 0 pt and their bold brethren. I've scoured these groups to try to solve this, and it is driving me batty. Any help would be great!- Hide quoted text - - Show quoted text - |
#9
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Removing styles
I run into similar problems. Typical offenders are styles that Word created
automatically and that start with a space character. Sorry, I don't know any way to get rid of them with VBA. Two options: Make sure the problematic styles aren't applied any more, then paste without the final paragraph mark into a new doc. The problematic styles should be left behind... but you may have to fix stuff (headers/footers...). The other option is to save in XML format, open as a text file, and fix or delete the problematic style definitions. Regards, Klaus "thedr9wningman" wrote: I love the tool, guys, but the darn 10pt style is still in there. I can't delete it. What does it take? "Greg Maxey" wrote: I don't know if thiw will help but it is a super-charged version of Klaus posting that he helped me put together a year or so ago: http://gregmaxey.mvps.org/Style_Report.htm On Mar 14, 11:38 am, thedr9wningman wrote: Regards, Klaus |
#10
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Removing styles
"Klaus Linke" wrote:
I run into similar problems. Typical offenders are styles that Word created automatically and that start with a space character. Yes, Word created this automatically. Two options: Make sure the problematic styles aren't applied any more, then paste without the final paragraph mark into a new doc. I did this (probably right before you posted this). Thank you. Maybe this will help someone else in the future! The key is not including that paragraph mark, though, definitely. The problematic styles should be left behind... but you may have to fix stuff (headers/footers...). The other option is to save in XML format, open as a text file, and fix or delete the problematic style definitions. I may do that in the future. Thank you. Regards, Klaus "thedr9wningman" wrote: I love the tool, guys, but the darn 10pt style is still in there. I can't delete it. What does it take? "Greg Maxey" wrote: I don't know if thiw will help but it is a super-charged version of Klaus posting that he helped me put together a year or so ago: http://gregmaxey.mvps.org/Style_Report.htm On Mar 14, 11:38 am, thedr9wningman wrote: Regards, Klaus |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete Styles | Microsoft Word Help | |||
Styles in Word 2003 | Microsoft Word Help | |||
removing styles across multiple documents | Microsoft Word Help | |||
Copied/imported styles get "corrupted" | Microsoft Word Help | |||
Importing Styles | New Users |