Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2007

Tip: Looking for answers? Try searching our database.

Need to delete multiple styles starting with same two characs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joffa - 27 Jan 2007 23:19 GMT
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
Perry - 27 Jan 2007 23:29 GMT
Check the *normal.dot* users are using ...
I think yr template is clean, but users have garbage in their normal.dot

Krgrds,
Perry

> Hi,
>
[quoted text clipped - 10 lines]
> Many thanks
> Alison
Joffa - 27 Jan 2007 23:40 GMT
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*

> Check the *normal.dot* users are using ...
> I think yr template is clean, but users have garbage in their normal.dot
[quoted text clipped - 16 lines]
> > Many thanks
> > Alison- Hide quoted text -- Show quoted text -
Perry - 28 Jan 2007 00:15 GMT
In order to assist you in yr salvage work, here are a couple of articles
worth looking in...
http://word.mvps.org/faqs/macrosvba/ResetStyles.htm
http://word.mvps.org/faqs/macrosvba/UpdateStyles.htm
http://word.mvps.org/faqs/macrosvba/CycleThruStyles.htm

Krgrds,
Perry

> Hi, normal.dot not the problem unfortunately. Problem associated with
> old template they are pasting from that has styles starting CS... in
[quoted text clipped - 26 lines]
>> > Many thanks
>> > Alison- Hide quoted text -- Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.