Salonee,
I'd like to do the same thing, but I'm working in Word 97 where there
doesn't appear to be a setting to view only styles in use. I'd be satisfied
if I could delete all the non-required styles since the only style in use
will be the Normal style.
Bob Dukes
hi,
If you try to delete unused styles through code, Word will
give you an error - 'Style does not exist'
However, You can hide the unused styles by selecting
the 'Formatting in use' in the Show combobox on the
Foramtting and Styles Task Pane (Office XP) . Thus the
taskpane will show only the styles that are currently in
use. You do not need a VBA for this.
HTH
Regards,
Salonee Sawant
Business Productivity Analyst
Maestros Mediline Systems Ltd.
India.
Quote:
>-----Original Message-----
>I'd like to come up with code to strip unused styles out
>of a Word document, and it seems like it would be simple.
>I was thinking it would be something like:
>Set mydoc = ActiveDocument
>For Each sty In mydoc.Styles
> If sty.InUse = False Then
> Delete
>But I don't quite have it right (or maybe I'm way off).
>Anyone know the way to achieve this?
>.