OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-12-2012, 13:44
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default include inside groups

If I have a document with Bacon on some pages and groups, I'd like to have my macro search including inside groups but it appears I don't have the proper code setup. Could you help? (I replaced the real object with fake names)
Code:
Sub Go()
    Dim s As Shape
    Dim sr As New ShapeRange
    Dim p As Page, i As Integer
    Dim OrigSelection As ShapeRange
    For i = 1 To ActiveDocument.Pages.Count
            ActiveDocument.Pages(i).Activate
    Set sr = ActivePage.Shapes.FindShapes(query:="@type='Bacon'")
    For Each s In sr
        s.Bacon.RevertToCarrots
    Next s
    Next i
End Sub
Reply With Quote
  #2  
Old 10-12-2012, 22:01
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Find in Group

I would change a couple of things, like adding all the found shapes to a ShapeRange first, then loop your ShapeRange to to your modification. So something like:
Code:
Sub FindBacon()
    Dim s As Shape
    Dim p As Page
    Dim srBacon As New ShapeRange
        
    For Each p In ActiveDocument.Pages
        srBacon.AddRange p.Shapes.FindShapes(Query:="@type='ellipse'")
    Next p
    
    For Each s In srBacon.Shapes
        s.ConvertToCurves
    Next s
End Sub
Hope that helps,

-Shelby
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
include groups - gathering text totals gorgo CorelDRAW/Corel DESIGNER VBA 4 27-07-2011 09:10
include groups - reverting symbols to objects gorgo CorelDRAW/Corel DESIGNER VBA 1 25-03-2011 13:16
Does Document.Title include extension? CWCN CorelDRAW/Corel DESIGNER VBA 1 19-02-2009 00:30
Processing inside groups ddonnahoe CorelDRAW/Corel DESIGNER VBA 8 07-08-2005 14:34
Include files Steve CorelDRAW/Corel DESIGNER VBA 2 29-09-2003 20:43


All times are GMT -5. The time now is 17:03.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com