OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 19-02-2009, 02:32
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe
Default Changing selection when two-shape group loses one shape

Hello again!

Have a somewhat specific problem here - Say I have done certain actions and grouped together two objects - one is the base shape and the other is the result of macros actions, named, say "ResultShape".

If I then simply want to remove the ResultShape it's as easy as

After this is done the active selection jumps to the remaining shapes in the group (the base shapes) and the group object gets dissolved AFAIU. Now this is where the problems come in - if I need to work on a range of shapes, some of them being groups which need the removal of the "ResultShape", others being plain shapes which need to be processed. A problem occurs if I do something like:

ChangeRange.AddRange ActiveSelectionRange


For Each CurrentShape In ChangeRange
' Do something with the CurrentShape and an
' error occurs stating that the referenced shape (the group, I guess)
' no longer exists
The group is also named, say "ResultShapeGroup", but if I try to remove that from the selection then the base shapes which need processing also get removed.

Any ideas?
Reply With Quote
Old 19-02-2009, 03:50
Joe Joe is offline
Join Date: Nov 2008
Location: Latvia
Posts: 92
Send a message via Skype™ to Joe

Looks like it's a good idea to eat something in the morning so the brain gets some energy. Came up with a (somewhat ham-fisted?) solution myself:

'Find ALL the shapes (including the parent group AND its subshapes
CurrentRange.AddRange ActiveSelectionRange.Shapes.FindShapes()
'Remove the unnecessary shapes
'CorelDraw neatly takes care of the rest and we get a clean new seleciton
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
Replace shape with another shape dungbtl CorelDRAW/Corel DESIGNER VBA 24 28-12-2019 05:56
a shape on top of another Seelenquell CorelDRAW/Corel DESIGNER VBA 15 01-03-2008 09:08
Get Shape Index ID Value m31uk3 CorelDRAW/Corel DESIGNER VBA 6 08-02-2008 19:50
Symbol shape is not found in a group squonk CorelDRAW/Corel DESIGNER VBA 1 14-06-2007 07:32
How to select all shape ? -=HKLC=- CorelDRAW/Corel DESIGNER VBA 1 25-10-2004 01:10

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

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