OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 16-11-2012, 19:22
Craig Tucker Craig Tucker is offline
Join Date: Nov 2002
Posts: 73
Default Text in Powerclip

See Next Message...

Last edited by Craig Tucker; 17-11-2012 at 12:11.
Reply With Quote
Old 16-11-2012, 19:55
Craig Tucker Craig Tucker is offline
Join Date: Nov 2002
Posts: 73
Default Text in Powerclip

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

                        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.
Reply With Quote
Old 25-11-2012, 15:01
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
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 Text and Powerclips

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.

Sub TestFindAllShapes()
    FindAllShapes.Shapes.FindShapes(Type:=cdrTextShape).ApplyUniformFill CreateRGBColor(0, 0, 255)
End Sub
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()
        Set sr = ActivePage.Shapes.FindShapes()
    End If
        For Each s In sr.Shapes.FindShapes(Query:="!@com.powerclip.IsNull")
            srPowerClipped.AddRange s.PowerClip.Shapes.FindShapes()
        Next s
        srAll.AddRange sr
        sr.AddRange srPowerClipped
    Loop Until sr.Count = 0
    Set FindAllShapes = srAll
End Function
Reply With Quote
Old 27-11-2012, 09:11
Craig Tucker Craig Tucker is offline
Join Date: Nov 2002
Posts: 73
Default Text and Powerclips

Ah, Nice Shelby!
Much Thanks,
Reply With Quote

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
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

All times are GMT -5. The time now is 02:40.

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