Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA - CorelDraw X4

Status
Not open for further replies.

kphu

MIS
Joined
May 30, 2002
Messages
346
Location
US
Hi All,

I'm new to Coreldraw but having been writing VBA macros in office for a long time. I was given a project to help automate some tasks within the graphics dept. i basically have 2 approaches.

Approach 1: Copy shapes or objects from a current file and paste into new file - current approach I'm taking.

Approach 2: Creat the shapes or objects from scratch - no luck, when recording the macro I get a lot of recording of this command is not supported.


In terms of Approach 1 - i've written the following code but get an error on the copy line.

Code:
Sub copyhubshape()
Dim doc As Document
Set doc = ActiveDocument
Dim docn As Document
Set docn = CreateDocument
Dim shr As Shape
Set shr = doc.ActivePage.SelectShapesAtPoint(2.001, 7.268, True)

ActiveSelection.Copy
docn.ActiveLayer.Paste
End Sub

When it process the "activeselection.copy" line in vb, I get an error or unexpected error occurred while executing method coVGShape::copy message.

Any help would be much appreciated.

Thanks,

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top