OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 16-06-2019, 04:19
svk svk is offline
Junior Member
Join Date: Jul 2008
Posts: 3
Default Copy size

Till now I was using CorelDraw X5 and recently I have shifted to CorelDraw X9
And many of the old codes are now working anymore

I have this code which runs awesome on X5, can anyone help me so that it works on CorelDraw 2019. The code is as follows


Option Explicit
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const VK_SHIFT = &H10
Private Const VK_CONTROL = &H11

Sub EitherDim()
Dim s As Shape, sr As ShapeRange
Dim w As Double, h As Double, a As Double

Set sr = ActiveSelectionRange

sr(1).GetSize w, h
a = sr(1).RotationAngle

For Each s In sr
If IsShiftPressed() Then
's.SetSize w
s.SizeWidth = w
ElseIf IsCtrlPressed() Then
s.RotationAngle = a
's.SetSize , h
s.SizeHeight = h
End If
Next s
End Sub

Public Function IsShiftPressed() As Boolean
IsShiftPressed = (GetAsyncKeyState(VK_SHIFT) < 0)
End Function

Private Function IsCtrlPressed() As Boolean
IsCtrlPressed = (GetAsyncKeyState(VK_CONTROL) < 0)
End Function
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
X6 Save a copy knowbodynow CorelDRAW/Corel DESIGNER VBA 5 27-06-2012 19:19
How can I copy an Envelope? RobC CorelDRAW/Corel DESIGNER VBA 13 11-04-2008 14:33
Copy Layer Mike83 Corel Photo-Paint VBA 0 09-02-2006 09:41
Draw X3: bug in "Font Size Next Combo Size" wOxxOm General 3 31-01-2006 13:49
How sets size form same as size images ? woycek21 Corel Photo-Paint VBA 0 09-07-2005 13:30

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

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