Для интереса и для расширения возможностей макросов VBA для CorelDraw решил перевести их на AutoIt.
Уперся в проблему с экспортом через ExportEx.
Вылет с ошибкой:
(34) : ==> The requested action with this object has failed.:
$expflt = $myDoc.ExportEx($s, 772, 2, $expopt)
$expflt = $myDoc.ExportEx($s, 772, 2, $expopt)^ ERROR
>Exit code: 1 Time: 0.423
Помогите кто может, пожалуйста!
Уперся в проблему с экспортом через ExportEx.
Вылет с ошибкой:
(34) : ==> The requested action with this object has failed.:
$expflt = $myDoc.ExportEx($s, 772, 2, $expopt)
$expflt = $myDoc.ExportEx($s, 772, 2, $expopt)^ ERROR
>Exit code: 1 Time: 0.423
Помогите кто может, пожалуйста!
Код:
Global $myCorel= ObjCreate("CorelDRAW.Application")
Global $myDoc=$myCorel.ActiveDocument
Global $expopt = $myCorel.CreateStructExportOptions ;As StructExportOptions
Global $expflt ;As ExportFilter
Global $s
$myDoc.Unit = 3
If $myCorel.Documents.Count = 0 Then
MsgBox("","Нет открытых документов")
Exit
EndIf
For $i = 1 To 100
$s = "g:\Temp\" & $myDoc.Name & "_" & $i & ".tif"
If NOT FileExists($s) Then
ExitLoop
EndIf
Next
With $expopt
.UseColorProfile = True
.ResolutionX = 150
.ResolutionY = 150
.ImageType = 5 ;cdrCMYKColorImage
.AntiAliasingType = 1 ; 0-cdrNoAntiAliasing, 1-cdrNormalAntiAliasing, 2-cdrSupersampling
.UseColorProfile = True
.Compression = 1 ;cdrCompressionLZW
.Dithered = False
.Transparent = False
.MaintainLayers = False
.AlwaysOverprintBlack = True
EndWith
$expflt = $myDoc.ExportEx($s, 772, 2, $expopt) ; ,Const cdrTIFF = 772 (&H304) ,cdrSelection=2,
$expflt.Finish