Thread: [Solved] Using macro to delete styles
View Single Post
 
Old 10-10-2011, 12:23 PM
fogharty fogharty is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jul 2011
Posts: 4
fogharty is on a distinguished road
Default Using macro to delete styles

I'm working with documents where there are a lot of unused styles. I tried to record a macro using the organizer to delete unwanted styles, but I can't get it to work. I tried to edit it, and what I came up with is:

Application.OrganizerDelete Source:= _
"ActiveDocument" _
, Name:="body play", Object:=wdOrganizerObjectStyles

repeated for each style.

I'm thinking the "ActiveDocument" is the problem.

If I could get this to work, it would be better for my purposes than the usual things, copying and pasting in a new template, etc.

This is in Word 2007.
Reply With Quote