Ito do this programmatically is an absolute CHORE. I have never bothered!
You have to:
1) Store all the properties of the wrong-named style in an array.
2) Create a new style with the correct name (if the new style does not
exist, Word will honour the case in your name).
3) Set the properties of the new style to be those you stored.
4) Run a Find/Replace to find every instance of BADSTYLE and replace it
with GoodStyle (make certain the text parts of the Find What and Replace
With dialogs are REALLY empty, or you will lose text...)
5) Delete the (now unused...) BADSTYLE from the document. Make sure it's
not applied to any text first, otherwise that text will get Normal style
when you delete the BadStyle.
If you do it like that, it will work. But while the bad style exists, you
can change its name, but Word will ignore the case of your new name.
Cheers
Thanks for explaining it.
I did try with a QuickKeys demo, but I couldn't get it to work.
Actually no.
I luse Movie Magic Screenwriter 2000 to write TV scripts. I have a job
to do which requires a specific - and non-standard - format in Word.
I can export as rtf from Screenwriter and paste into a template based on
the production company's format.
It works just fine - so long as I change the Style Names.
Can't do that in Screenwriter - or in Final Draft (which I also have but
don't use unless I can't avoid it). So the change has to be in Word.
Which is what I end up having to do. No big sweat, but it would be nice
to be able to do it automatically.
--
Don't wait for your answer, click here:
http://www.word.mvps.org/
Please reply in the group. Please do NOT email me unless I ask you to.
John McGhie, Microsoft MVP, Word and Word:Mac
Nhulunbuy, NT, Australia. mailto:
[email protected]