OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 23-05-2007, 10:19
knowbodynow knowbodynow is offline
Senior Member
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434
Default Select All Text On a Layer

I'd like to be able to select all the text on a layer. I'd like to include groupshapes that consist only of text. But if a groupshape is a mix of text and other objects I want to exclude it. I tried the following which didn't work:

sub selecttxtlayer()

Dim s As Shape, ss As Shape
Dim tc As Integer


For Each s In ActiveSelection.Shapes

    If s.Type = cdrGroupShape Then
        For Each ss In s.Shapes
        If ss.Type = cdrTextShape Then tc = tc + 1
        Next ss
        If s.Shapes.Count <> tc Then s.RemoveFromSelection
    End If
Next s

end sub
This works with groups of text as long as there is no group containing text and another object on the layer. If that is the case then it seems to exclude all groups.

I'm sure I'm going about this the wrong way. Can someone please put me on the right track.


Chris (Hunt)
Reply With Quote
Old 23-05-2007, 16:39
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4

You need to reset your "tc" counter to 0 before you process a new group
Reply With Quote
Old 24-05-2007, 20:08
knowbodynow knowbodynow is offline
Senior Member
Join Date: Mar 2006
Location: Hatsukaichi near Hiroshima
Posts: 434

Thanks Alex, that was exactly the help I needed.

Best wishes,

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
Striping a word down to the first letter only knowbodynow CorelDRAW/Corel DESIGNER VBA 9 19-04-2007 15:14
::LayerControl:: macro for FAST layer management in CorelDraw wOxxOm CorelDRAW/Corel DESIGNER VBA 0 10-05-2006 11:40
Select specified text, change font size? fiddler2b CorelDRAW/Corel DESIGNER VBA 3 23-04-2006 08:11
VBA help needed - changing colours fremoikaner CorelDRAW/Corel DESIGNER VBA 1 18-11-2004 06:06
Select Paragraph Text with more than one color joexx CorelDRAW/Corel DESIGNER VBA 2 06-10-2004 12:20

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

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