WITHOBJECT "CorelDraw.Automation.8"
DIM FCOUNT
DIM FILESARR$(100)
FCOUNT = 1
.FileNew
FILESARR(FCOUNT) = FINDFIRSTFOLDER("c:\aaaa\myworks\*.cdr", 1 OR
2 OR 4 OR 32 OR 128)
WHILE (FILESARR(FCOUNT) <> "" )
.FileImport "C:\aaaa\myworks\"& FILESARR(FCOUNT)
.FileExport "C:\aaaa\myworks\"& FILESARR(FCOUNT)&
".eps", 1289, 300, 300, 73, 73, 2, 0, TRUE
.SelectAllObjects
.DeleteObject
FCOUNT = FCOUNT + 1
FILESARR(FCOUNT) = FINDNEXTFOLDER()
WEND
END WITHOBJECT
(It run correctely for printing too !)
Could anybody find a way to ameliore the script to :
1/ make the script open
CorelDraw by itself (Without Ole error)
2/ Arrange the script to
have the name of final EPS file in good writing
(presentely the name of file is like this : " FILE.CDR.EPS " )
Have you any IDEA ?
i&=LEN(InFile$) ' Input File Name
do while i>0 and mid(File$,i,1)<>"."
i=i-1
loop
if i=0 then i=len(InFile$)+1
OutFile$="C:\aaaa\myworks\"+Left(InFile,i-1)+".eps"
SUB SplitFileName(FileName$,BYREF Path$,BYREF Name$,BYREF Ext$)
i&=0
p&=1
WHILE p<>0
p&=INSTR(FileName,"\",i+1)
IF p<>0 THEN i=p
WEND
Path$=LEFT(FileName,i)
s&=i
p&=1
WHILE p<>0
p&=INSTR(FileName,".",i+1)
IF p<>0 THEN i=p
WEND
IF i=s then i=LEN(FileName)+1
Name$=MID(FileName,s+1,i-s-1)
Ext$=MID(FileName,i)
END SUB
SplitFileName "C:\TEMP\Myfile.cdr",Path$,Name$,Ext$
Olivier Fournier <ocr...@wanadoo.fr> wrote in message news:37A343A3...@wanadoo.fr...