connecting users of the CorelDRAW family of products

macro help - please

rated by 0 users
Not Answered This post has 0 verified answers | 6 Replies | 0 Followers

Share  
Page 1 of 1 (7 items) | RSS

pkg_sriram posted on Sat, Jun 23 2012 0:02

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

All Replies

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.CreateSelection

End 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.CreateSelection

End 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.CreateSelection

End 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.CreateSelection

End Sub

hi Fantastic man, its working as i expeted. Besides i need yet another help.... if multiple objects are selected and i want those multiple objects (which are placed on above the other randomly) to be aligned Left, Right, Top & Bottom sides on theirs extreme ends Thanking you
Page 1 of 1 (7 items) | RSS
© Corel Corporation. The content herein is in the form of a personal web log ("Blog") or forum posting. As such, the views expressed in this site are those of the participants and do not necessarily reflect the views of Corel Corporation, or its affiliates and their respective officers, directors, employees and agents. Terms and Conditions / User Guidelines.