OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > Corel Script > CorelDRAW CS

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 15-12-2010, 13:40
Mate
Guest
 
Posts: n/a
Default

Hello,

I have been using Corel script with Corel Draw 9 for quite some time. Now it's time to change to X3. Here is where my problem begins. There is almost no documentation regarding Corel Script (except the tutorial on this page) on the Internet, so I will try my luck here.

I have quite a large script with subs and functions, opening file dialogs and files from disk, parsing them and creating cdr file at the end. I would like to somehow use this script with X3 (the script is working with version 11).

Changing automation to .13, I get the Run-time error 1000. OLE Automation error (The selected script could not be run because there are no selected objects or the script was not dropped on an object).

Including the script in visual basic with
Code:
Sub ApplicationCorelScript()
Dim cs As Object
Set cs = CorelScript
is difficult because I have more functions and I don't know, how to "wrap" it correctly. A preview of the starting point:
Code:
' Functions declarations
declare function getGridSizeX(tablePropertiesLine as string) as integer
declare function getGridSizeY(tablePropertiesLine as string) as integer
...etc...

' Get xml file
filter$ = "XML files|*.xml|All Files|*.*"
fileFromFileBox$ = getfilebox (filter$, "Select xml file to import")

global files$(100)

if ".xml" = right(fileFromFileBox,4) then
	files(1) = fileFromFileBox
else
	message "not found."
	stop
endif

withObject "CorelDraw.Automation.13"

global fileSettings$
global gridXpreset%
...etc...

counter% = 0
while len(files(counter+1))>0 and counter < 99
	doSomeWork(files(counter+1))
	counter = counter +1
wend

message "Done."

'* Functions declarations. *

sub soSomeWork (file as string)
	filename$ = getOnlyFileName(file)

and so on for a few 100 lines.
Is there a simple workaround to get this working, or will I have to rewrite the whole thing to Visual Basic?

Thanks for any help in advance.
Reply With Quote
Reply


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
Saving File while auto generating Jpg files vindaa Macros/Add-ons 16 03-01-2007 19:44
saving draw i2 files as draw 11 files KDJ General 5 01-03-2006 17:26
Multiple files in for filtering Loadus Corel Photo-Paint VBA 2 27-04-2005 16:09
Transfer shapes from Draw to Paint; Using CorelScript in VB6 DWGraphics Corel Photo-Paint VBA 1 18-08-2004 20:49
Would you miss CorelScript object? Alex CorelDRAW/Corel DESIGNER VBA 32 04-02-2004 14:59


All times are GMT -5. The time now is 11:57.


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