RemoveChar Macro

L

LMo

I am currently using the following acor to delete a single char style.
However I am in need of a macro which will remove more than 1 char. Can this
be accomplished through use of a wildcard? If not, doe anyone have a
suggestion on how to rid my docs of multiple char styles?

Sub RemoveCharStyle()
Dim styl As Word.Style, doc As Word.Document
Set doc = ActiveDocument
Set styl = doc.Styles.Add(Name:="Style1")
On Error Resume Next
doc.Styles("Body Text_ACSSC Char").LinkStyle = styl
styl.Delete
End Sub
 
S

Stefan Blom

Klaus Linke has posted this macro:

Sub LinkStylesToRegularCharStyles()
Dim myStyle As Style
Dim myStyleLinkStyle As Style
For Each myStyle In ActiveDocument.Styles
' only look at character styles, and links style <> Normal:
If myStyle.Type = wdStyleTypeCharacter And _
myStyle.LinkStyle <> ActiveDocument.Styles(wdStyleNormal) _
Then
Set myStyleLinkStyle = myStyle.LinkStyle
Debug.Print myStyleLinkStyle, myStyle
myStyle.LinkStyle = _
ActiveDocument.Styles(wdStyleNormal)
myStyleLinkStyle.LinkStyle = _
ActiveDocument.Styles(wdStyleNormal)
End If
Next myStyle
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top