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 29-06-2007, 12:17
Manuel
Guest
 
Posts: n/a
Default Is this a bug?

I create a few shapes in Draw, group them all and run this macro:
Code:
Sub Test()
Dim sh As Shape
Set sh = ActiveShape
sh.Stretch 1.2, 1.2
MsgBox sh.AbsoluteHScale, vbOKOnly, "blah"
End Sub
I get the correct value.

but if I just select the shapes and run this macro:

Code:
Sub Test()
Dim sh As Shape
Set sh = ActiveDocument.Selection
sh.Group
sh.Stretch 1.2, 1.2
MsgBox sh.AbsoluteHScale, vbOKOnly, "blah"
End Sub
The value is always 1
Reply With Quote
  #2  
Old 29-06-2007, 12:31
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

AbsoluteHScale and other properties like that do not apply to the selection shape. Because the selection shape itself doesn't really represent any shape in particular.

However your code has some inaccuracies which can be fixed:

Code:
Sub Test()
    Dim sh As Shape
    Set sh = ActiveDocument.Selection
    Set sh = sh.Group
    sh.Stretch 1.2, 1.2
    MsgBox sh.AbsoluteHScale, vbOKOnly, "blah"
End Sub
the Group method returns the resulting group shape which you should use to work on the group. Otherwise you continue to work with the selection shape that just happens to have one object in the selection...
Reply With Quote
  #3  
Old 29-06-2007, 13:03
Manuel
Guest
 
Posts: n/a
Default

Duh!! where is my brain today?
Now it works, 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


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


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