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 11-12-2009, 07:00
biok
Guest
 
Posts: n/a
Default issue selecting shapes in ActivePage

Hi everyone, I'm having an issue when I try to select all the shapes in the active Page. The problem is when I have just one shape in the Page.

Code:
Dim sr As ShapeRange
sr  = ActivePage.Shapes.All
msgBox sr.count
Sr.count Return 0. Is this a bug or what??
Reply With Quote
  #2  
Old 11-12-2009, 09:29
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi,
Objects are a little different then variables.
You have to use the set keyword.

Just put "set" in front of sr.

-John
Reply With Quote
  #3  
Old 11-12-2009, 10:37
biok
Guest
 
Posts: n/a
Default

Yes I use "set" I just forgot when I write the post... This doesn't work If there's just one shape in the page.

Code:
Dim sr As ShapeRange
set sr  = ActivePage.Shapes.All
msgBox sr.count
sr.count ---> return 0
Reply With Quote
  #4  
Old 11-12-2009, 11:37
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi,
It's returning 1 for me.

What version are you using?

-John
Reply With Quote
  #5  
Old 14-12-2009, 07:37
biok
Guest
 
Posts: n/a
Default

Oh sorry my fault, what I was doing exactly was...
Code:
Dim sh As Shape
Dim sr As ShapeRange
Set sh = ActivePage.Shapes.All.Group
sh.AlignToPageCenter cdrAlignLeft + cdrAlignRight, cdrTextAlignBoundingBox
sh.AlignToPageCenter cdrAlignTop + cdrAlignBottom, cdrTextAlignBoundingBox
Set sr = sh.Shapes.All
That's why didn't work. I've just fix it
Code:
Dim sh As Shape
Dim sr As ShapeRange
ActivePage.Shapes.All.Group
Set sr = ActivePage.Shapes.All
sr.AlignToPageCenter cdrAlignLeft + cdrAlignRight, cdrTextAlignBoundingBox
sr.AlignToPageCenter cdrAlignTop + cdrAlignBottom, cdrTextAlignBoundingBox
I think I was kind of dizzy when I posted this...Either way thanks
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
Selecting shapes during a macro still runs mateushenrico CorelDRAW/Corel DESIGNER VBA 1 21-02-2009 00:38
Selecting shapes in rectangle area lukswa CorelDRAW/Corel DESIGNER VBA 2 07-10-2008 02:13
Eraser issue jahmer General 0 17-01-2008 15:59
SetSize issue Dave Rowland CorelDRAW/Corel DESIGNER VBA 3 11-01-2008 16:36
Selecting multiple Named shapes Mitsu1 CorelDRAW/Corel DESIGNER VBA 2 09-11-2006 10:07


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


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