Removing a Character Style

J

Jose Valdes

In Word 2003, I am looking for the shortest number of key strokes to remove
a Character style that is used throughout a long manual without removing any
Paragraph styles or text. I plan to write a VBA script to do this work. The
following is my current process. If anyone knows a better way of doing this,
please let me know.
Before you Begin: Configure the Find dialogue to find the character style to
be removed.

Removing a Character Style:

1. Ctrl+F

2. Click "Find Next".

3. Note the paragraph style

4. Click "Clear Formatting" in the "Style and Formatting" task pane.

5. Reapply paragraph style

Thanks! Jose
 
B

Bear

Jose:

I don't know your objective in detail, but ...

- If you simply delete the character style definition, all styled text
reverts to the paragraph defaults.

- You can find and replace a character style with the character style
"Default Paragraph Font" which has the effect of removing the character style.

- To use the keyboard to remove a selected instance of a character style,
you press Ctrl+Spacebar. When you record this, you get the following VBA:

Selection.Font.Reset

- You could easily do a VBA version of Find and Replace like this:

With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Style = strTargetStyle
.Replacement.Style = strResultStyle
.Execute Replace:=wdReplaceAll
End With

Note that when using a range rather than the selection, you don't really
have to worry about clearing any of the settings. So the .ClearFormatting and
..Replacement.ClearFormatting aren't really needed. Neither will this code
change any settings in the GUI Find and Replace dialogs. In other words, your
users won't be surprised that one of your macros changed the Find operation
they were doing before they ran the macro.

Bear
 
J

Jose Valdes

Thanks! You didn't know my "objective in detail", but your answer was so
complete that you didn't need to. I didn't think to delete the character
style because I intend to use it again. In this case, however, I can do just
that because the character style lives in a sub-document where I won't need
it again. Thanks!
 
J

Jose Valdes

*** I am reposting the following message because it failed to appear on
word.docmanagement ***

Thanks! You didn't know my "objective in detail", but your answer was so
complete that you didn't need to. I didn't think to delete the character
style because I intend to use it again. In this case, however, I can do just
that because the character style lives in a sub-document where I won't need
it again. Thanks!
 

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