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 16-11-2012, 18:22
Craig Tucker Craig Tucker is offline
Member
 
Join Date: Nov 2002
Posts: 73
Default Text in Powerclip

See Next Message...

Last edited by Craig Tucker; 17-11-2012 at 11:11.
Reply With Quote
  #2  
Old 16-11-2012, 18:55
Craig Tucker Craig Tucker is offline
Member
 
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

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 19:01.
Reply With Quote
  #3  
Old 25-11-2012, 14:01
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 11
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.


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
-Shelby
Reply With Quote
  #4  
Old 27-11-2012, 08:11
Craig Tucker Craig Tucker is offline
Member
 
Join Date: Nov 2002
Posts: 73
Default Text and Powerclips

Ah, Nice Shelby!
Much Thanks,
Craig
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
color palette and powerclip robert Macros/Add-ons 4 25-01-2013 15:35
Fountain to bitmap in powerclip grzjanik Macros/Add-ons 15 08-09-2011 13:37
CQL does not find shapes in PowerClip aakkaarr CorelDRAW/Corel DESIGNER VBA 3 11-05-2011 17:44
Rotation and PowerClip Craig Tucker CorelDRAW/Corel DESIGNER VBA 3 23-08-2007 16:31
powerclip extract zaum CorelDRAW/Corel DESIGNER VBA 2 26-10-2005 07:26


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


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