Reply
 
Thread Tools Display Modes
  #1   Report Post  
Mark K
 
Posts: n/a
Default Renaming Word 2002 "Paragraph and Character" styles

I have read many of the responses and tried solutions, but so far have
not been able to crack my problem.

I have older files that need to be edited and sent off. They have the
old Char Char problem. The style I'm concerned with is a created
style "Main Body Text" and its mutations Main Body Text Char Char,
Char Char Char Char, Char Char Char Char Char Char Char Char, and so
forth.

At present I search for these mutations and replace them manually with
"Main Body Text" - they are not linked so that is easy. Then
delete them manually. Problem is some documents have so many it takes
for ever.

If only I had a macro that would find all occurrences of the style
"Main Body Text Char *" and replaced it with "Main Body Text" I
tried the following macro but it does pick them up.

Any ideas?
Many thanks,
Mark

Sub Macro1()
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Main Body Text Char
*")
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Main Body
Text")

  #2   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

Hi Mark,

I
tried the following macro but it does pick them up.

The * wildcard won't work when searching a style name in a
document. You'd need to search each style, individually.

What you could perhaps do is use a For Each loop to check
the presence of the basic style and Char in each style's
name. Roughly, like this (untested)

For each styl in ActiveDocument.Styles
s = styl.LocalName
If Instr(s, "Char") 0 Then
If Instr(s, "Main text") 0 Then
'Find/Replace using s
End If
End If
Next

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)

  #3   Report Post  
Klaus Linke
 
Posts: n/a
Default

Besides Cindy's macro, you could check out Andrew Savikas' from he
http://hacks.oreilly.com/pub/h/2597

I haven't tested much, but it seemed to work pretty well.

Regards,
Klaus


  #4   Report Post  
Mark K
 
Posts: n/a
Default

Many thanks, I'll give it a try.

Mark

  #5   Report Post  
Mark K
 
Posts: n/a
Default

Hi
Thanks
Yes, I have tried and retried this macro/function. But, on my PC Word
stops responding when I use it. I've had a bit of a look at what its is
doing, but cannot see why it would lock up.

Mark



  #6   Report Post  
Mark K
 
Posts: n/a
Default

Cindy

I gave it a go, but can't get it to work. The find replace bit has me
stumpted as to what I should do.

Mark

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
Multiple styles in a single paragraph skibikegolf Microsoft Word Help 1 January 5th 05 10:57 AM
Can a style become font-neutral? F A L Page Layout 5 December 3rd 04 02:12 PM


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

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

About Us

"It's about Microsoft Word"