Hi all
I do not know about scripting in coreldraw. Can anybody help me in the below
script to include duplicate command so that object should move along with duplicate.
Please help me
Love you all
Sub MoveUp() ActiveDocument.Unit = cdrMillimeter y = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move 0, y End Sub Sub MoveDown() ActiveDocument.Unit = cdrMillimeter y = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move 0, -y End Sub Sub MoveLeft() ActiveDocument.Unit = cdrMillimeter x = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move -x, 0 End Sub Sub MoveRight() ActiveDocument.Unit = cdrMillimeter x = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move x, 0 End Sub
Sub MoveDown() ActiveDocument.Unit = cdrMillimeter y = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move 0, -y End Sub
Sub MoveLeft() ActiveDocument.Unit = cdrMillimeter x = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move -x, 0 End Sub
Sub MoveRight() ActiveDocument.Unit = cdrMillimeter x = ActiveSelection.Shapes(1).SizeHeight ActiveSelection.Move x, 0 End Sub
Where do you want the duplicate to be? On top of the active selection or in the original position? What are you trying to achieve? Cheers.
Hi
Using above gsm of Move up, down, left and right it moves object its position i want to move along with duplicate
hope you got me
thanking you
So, every time you move the object a new duplicate will be created? How will that be useful?
I have a macro that creates a duplicate next to the original and selects the duplicate, would that be useful?
yes i need that one
I hope these are helpful:
Sub DupRight() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(sr.SizeWidth, 0) sn.CreateSelectionEnd Sub Sub DupLeft() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(-sr.SizeWidth, 0) sn.CreateSelectionEnd Sub Sub DupDown() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(0, -sr.SizeHeight) sn.CreateSelectionEnd Sub Sub DupUp() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(0, sr.SizeHeight) sn.CreateSelectionEnd Sub
Sub DupLeft() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(-sr.SizeWidth, 0) sn.CreateSelectionEnd Sub
Sub DupDown() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(0, -sr.SizeHeight) sn.CreateSelectionEnd Sub
Sub DupUp() Dim sr As ShapeRange Dim sn As ShapeRange Set sr = ActiveSelectionRange If sr.Count = 0 Then MsgBox "Nothing selected" Exit Sub End If Set sn = sr.Duplicate(0, sr.SizeHeight) sn.CreateSelectionEnd Sub