OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > Corel Photo-Paint VBA

Thread Tools Search this Thread Display Modes
Old 29-05-2004, 14:40
Posts: n/a
Default Drawing a cross hair

Hi everyone,

I started scripting VB for the first time ever, as part of my project in Corel PhotoPaint. I am trying to write code to draw 2 lines as part of a crosshair.
So far I have successfully extracted the coordinates (x1,y1,x2,y2) and (x3,y3,x4,y4) from a textfile as part of the procedure in the module.

I want to use these coordinates to draw 2 lines (as objects), with the above-mentioned coordinates on to the background image. This is the code I have tried to use:

Call Application.CorelScript.LineTool(3, 0, 0, 0, 0, 0)
Call Application.CorelScript.StartDraw(x1, y1, 0, 0, 0, 0)
Call Application.CorelScript.ContinueDraw(x2, y2, 0, 0, 0, 0)
Call Application.CorelScript.EndDraw

Call Application.CorelScript.LineTool(3, 0, 0, 0, 0, 0)
Call Application.CorelScript.StartDraw(x3, y3, 0, 0, 0, 0)
Call Application.CorelScript.ContinueDraw(x4, y4, 0, 0, 0, 0)
Call Application.CorelScript.EndDraw

However, the macro terminates at line 2 of the code above (the startdraw line). The error message is:
Run-time error 1002: You need an open document for this operation

It says this, even though the image I want to work with is already open :?
Any ideas on how I can solve this problem?

Thank you all in advance.
Reply With Quote
Old 29-05-2004, 17:44
Posts: n/a
Default addendum

Hi guys,

I just wanted to say that I am using version 12 (I downloaded the full trial version from the corel website).

Also, I am not able to look at any of the VBA gms files on the oberonplace.com website. I tried copying the files to the directory suggested and i still can't see it in the play macro window.

Please help me solve this problem of creating the crosshair.

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
Suggestion - palette from existing drawing Webster CorelDRAW/Corel DESIGNER VBA 3 22-10-2004 03:18
document name and created date in Corel drawing eric CorelDRAW/Corel DESIGNER VBA 5 14-09-2004 22:17
Corel9Script- how to use Gamut alarm to modify a drawing? Kitemaker CorelDRAW CS 1 30-06-2004 16:04

All times are GMT -5. The time now is 02:15.

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