Is there a macro that would seek out all symbols in a document and revert them all to objects? I believe the symbols are really bogging down my file and there are too many at this point to find them. Thanks.
Are these supposed to jump to each page?
no only on current page
for all pages on active document try code below
Sub RevertSymbolsToObjects()Dim sh As ShapeRange, s As Shape, dp As PageActiveDocument.BeginCommandGroup ("RevertToOjects")For Each dp In ActiveDocument.Pagesdp.ActivateSet sh = ActivePage.Shapes.FindShapes(Type:=cdrSymbolShape)For Each s In shs.Symbol.RevertToShapesNext sNext dpActiveDocument.EndCommandGroupEnd Sub
I had to stop the operation by the way. It was going on for about an hour and a half and I had to do some more work. I'll try it again when my day is over.
I cannot guarantee success, but you might try this:
Sub RevertSymbols_active_page() Dim p As Page Dim s As Shape Dim sr As ShapeRange On Error GoTo ErrHandler ActiveDocument.BeginCommandGroup "revert symbols" EventsEnabled = False Optimization = True Set p = ActivePage Set sr = p.Shapes.FindShapes(Query:="@type = 'symbol'") For Each s In sr.Shapes s.Symbol.RevertToShapes Next s ExitSub: Optimization = False EventsEnabled = True ActiveDocument.EndCommandGroup Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub
That only reverts symbols on the current page, but I would try that first before moving on to a "do this for all pages" version (or perhaps a "do this for the next 5 pages" version, or...).
This worked on a single page.
Was it still super-slow to process that one page?
If I might ask, how many pages does your document have?
88 pages. No it was fast. Only one symbol on this particular page.
I would try it on a few more challenging pages.
You could "go for the gold" with an all-pages attempt:
Sub RevertSymbols_all_pages() Dim p As Page Dim s As Shape Dim sr As ShapeRange On Error GoTo ErrHandler ActiveDocument.BeginCommandGroup "revert symbols all pages" EventsEnabled = False Optimization = True For Each p In ActiveDocument.Pages Set sr = p.Shapes.FindShapes(Query:="@type = 'symbol'") For Each s In sr.Shapes s.Symbol.RevertToShapes Next s Next p ExitSub: Optimization = False EventsEnabled = True ActiveDocument.EndCommandGroup Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub
Or, you could try to process just a subset of the document at one time with something like this:
Sub RevertSymbols_some_pages() Dim lngPageIndex As Long Dim p As Page Dim s As Shape Dim sr As ShapeRange On Error GoTo ErrHandler ActiveDocument.BeginCommandGroup "revert symbols some pages" EventsEnabled = False Optimization = True For lngPageIndex = 1 To 5 Set p = ActiveDocument.Pages(lngPageIndex) Set sr = p.Shapes.FindShapes(Query:="@type = 'symbol'") For Each s In sr.Shapes s.Symbol.RevertToShapes Next s Next lngPageIndex ExitSub: Optimization = False EventsEnabled = True ActiveDocument.EndCommandGroup Exit Sub ErrHandler: MsgBox "Error occurred: " & Err.Description Resume ExitSub End Sub
Sometimes you may run into a problem where some specific content gives CorelDRAW trouble.
Other times, you may have something where it works OK for doing a modest amount of work at one time, but cannot successfully process the whole document. One might even have to process part of it, then save the file and close / restart CorelDRAW before doing another part of it.
It took about 5 minutes to process 5 pages. There were maybe two symbols on any of those pages in total.
You can edit the line:
For lngPageIndex = 1 To 5
to process a different set of pages in the document.
That's a little bit painful, but it has the benefit that, if you have success, you can at least save your document and have part of the job done!
You might check, as you did earlier, to see if it's going crazy with memory use.
How complicated are the symbols?
Nothing crazy. Mostly hardware.
I guess I am wondering - even aside from automation - why the reverting of symbols to regular shapes is so slow.
Any chance that this is some of the nasty AMD video card / Windows 10 Creators Update performance problems some users have experienced with CorelDRAW?
I know that some of your information is proprietary. Could you share one of the symbols that takes ~5 minutes to revert?
If you create a new symbol - something simple - then is that also very slow to revert?