Need to delete multiple styles starting with same two characs?

J

Joffa

Hi,

I'm trying to write a macro in Word 2000 that will delete 20 odd
styles that start with the letters CS as I've recreated the template,
however, every time a user copies in data from the old template to a
document based on my new template, it brings those old style starting
with CS back into the document. I've tried using wildcards (see below)
to delete any styles that start with the same first two letters but
with no success and would appreciate any help?

ActiveDocument.Styles("CS*").Delete



Many thanks
Alison
 
P

Perry

Check the *normal.dot* users are using ...
I think yr template is clean, but users have garbage in their normal.dot

Krgrds,
Perry
 
J

Joffa

Hi, normal.dot not the problem unfortunately. Problem associated with
old template they are pasting from that has styles starting CS... in
it so need to be able to write a macro that deletes any styles that
start with CS... as the problem is likely to remain for quite a while
as have hundreds of documents that used old template that users will
probably use as a base and opt to save as therefore bringing the
styles with them. Therefore if I can write a macro to attach to a
button, it can delete these styles for as long as the problem exists -
just can't get the code right as doesn't seem to want me to use CS*
 

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