![]() |
|
#1
|
|||
|
|||
![]()
See Next Message...
Last edited by Craig Tucker; 17-11-2012 at 12:11. |
#2
|
|||
|
|||
![]()
I came up with this that works with no errors.
I process Powerclips first, then NonPowerclips. Does anyone know of a better way without so many loops and finds? Thanks, Craig Code:
foreach (CorelDRAW.Shape cdrTextShape in CorelDrawApplication.ActivePage.ActiveLayer.Shapes.FindShapes(null, CorelDRAW.cdrShapeType.cdrNoShape, true, "!@com.powerclip==null")) { foreach (CorelDRAW.Shape cdrTextShape1 in cdrTextShape.PowerClip.Shapes.FindShapes(lcCurrentShapeName, CorelDRAW.cdrShapeType.cdrTextShape, false, "")) { ReplaceTextShapeAttributes(cdrTextShape1, shapeElement); } } foreach (CorelDRAW.Shape cdrTextShape in CorelDrawApplication.ActivePage.ActiveLayer.Shapes.FindShapes(lcCurrentShapeName, CorelDRAW.cdrShapeType.cdrTextShape, false, "")) { { ReplaceTextShapeAttributes(cdrTextShape, shapeElement); } } Last edited by Craig Tucker; 16-11-2012 at 20:01. |
#3
|
||||
|
||||
![]()
My answer is no more correct than yours, but is a different approach that you might find useful or a combination of yours and my code. Since I need to look for all shapes often I wrote a generic Function to return all shapes, including those shapes that are deeply powerclipped.
The code below calls my function and fills all text found blue. The text can be in a powerclip that is in a powerclip. Code:
Sub TestFindAllShapes() FindAllShapes.Shapes.FindShapes(Type:=cdrTextShape).ApplyUniformFill CreateRGBColor(0, 0, 255) End Sub Code:
Function FindAllShapes() As ShapeRange Dim s As Shape Dim sr As ShapeRange Dim srAll As New ShapeRange, srPowerClipped As New ShapeRange If ActiveSelection.Shapes.Count > 0 Then Set sr = ActiveSelection.Shapes.FindShapes() Else Set sr = ActivePage.Shapes.FindShapes() End If Do For Each s In sr.Shapes.FindShapes(Query:="!@com.powerclip.IsNull") srPowerClipped.AddRange s.PowerClip.Shapes.FindShapes() Next s srAll.AddRange sr sr.RemoveAll sr.AddRange srPowerClipped srPowerClipped.RemoveAll Loop Until sr.Count = 0 Set FindAllShapes = srAll End Function |
#4
|
|||
|
|||
![]()
Ah, Nice Shelby!
Much Thanks, Craig |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
color palette and powerclip | robert | Macros/Add-ons | 4 | 25-01-2013 16:35 |
Fountain to bitmap in powerclip | grzjanik | Macros/Add-ons | 15 | 08-09-2011 14:37 |
CQL does not find shapes in PowerClip | aakkaarr | CorelDRAW/Corel DESIGNER VBA | 3 | 11-05-2011 18:44 |
Rotation and PowerClip | Craig Tucker | CorelDRAW/Corel DESIGNER VBA | 3 | 23-08-2007 17:31 |
powerclip extract | zaum | CorelDRAW/Corel DESIGNER VBA | 2 | 26-10-2005 08:26 |