How come, when I try to record a macro, I can't duplicate an object?

Duplicate works fine, but when I try to record a macro, it duplicates but the object is no longer held by the mouse.

No Data
  • Ahhh. Alt+F11. Changed my life.

    Recording macros can be helpful in the beginning when you are figuring the language out. There is an occasional benefit which can hang around for some time even as you get more and more comfortable with manual coding, but it diminishes as you become familiar with what things are called and which actions are controlled by which "magic words". Otherwise, yep, Myron and Eskimo are right and it sounds like you're interested. Good. Its amazing. Seriously, it can even be mind-blowingly amazing what you can do with code.

    A few years ago I came around here looking for help too and was well guided by some of these guys.

    Be sure to check out the Object Browser (F2) in VBA. Search terms like "shape", "curve", "active", etc. and browse the results, pushing F1 on those which interest you, which will bring up the help window that frequently contains an example piece of code and an explanation of what it does. For example, I just did a search for "active", clicked on the row in which "Application" is the class and "ActiveSelection" is the member, pressed F1 and was shown:

    VBA example

    The following VBA example colors the selected shapes green, if the shape selected is an ellipse.

    Sub SelectionActive()
    Dim s As Shape
    For Each s In ActiveSelection.Shapes
    If s.Type = cdrEllipseShape Then
    s.Fill.UniformColor.CMYKAssign 100, 0, 100, 0
    End If
    Next s
    End Sub

    You copy and paste that into VBA, which you'll know how to do after following Eskimo's advice, then try it out. Then try 50 more if you like. You'll learn how it works, and why. Someone showed me this when I was getting started, and its a nice beginner's boost:

    Assign shortcuts to your macros or create buttons in Corel's Options (ctrl+j). There will be a point where you will probably need to do both, as you run out of logical key and key combo choices.

    It can be tough to get started, but if you stick with it you'll benefit greatly.