#1   Report Post  
Geoff O
 
Posts: n/a
Default 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   Report Post  
CyberTaz
 
Posts: n/a
Default

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   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

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?


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Jeanne M Jeanne M is offline
external usenet poster
 
Posts: 10
Default Removing styles

Klaus: I could kiss you!


  #6   Report Post  
Posted to microsoft.public.word.docmanagement
thedr9wningman thedr9wningman is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
thedr9wningman thedr9wningman is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
thedr9wningman thedr9wningman is offline
external usenet poster
 
Posts: 4
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Styles Hague2 Microsoft Word Help 9 July 31st 07 11:25 AM
Styles in Word 2003 Jessy Microsoft Word Help 2 February 1st 05 11:49 AM
removing styles across multiple documents jd_editor Microsoft Word Help 1 January 20th 05 09:41 PM
Copied/imported styles get "corrupted" Paul_at_Work Microsoft Word Help 10 December 3rd 04 03:15 PM
Importing Styles Charles Kenyon New Users 0 November 24th 04 11:38 PM


All times are GMT +1. The time now is 04:35 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"