Hello,
There is a new problem with EmptyParam that doesn't exists in old
versions of TMS Scripter (Version 2.1 Sep 2011). All TMS Scripter
Tested on same version of Delphi 2010 and Windows 7.
Easy to reproduce. Just test this script
with an empty Word .doc file (sample.doc) :
var
vMSWord,r:olevariant;
Title,Separator:string;
Formata,Direction:integer;
begin
try
vMSWord := GetActiveOleObject('Word.Application');
except
vMSWord := CreateOleObject('Word.Application');
end;
vMSWord.Visible := True;
vMSWord.Documents.Open ('c:\sample.doc');
Title := 'Column1;Column2;Column3;Column4';
R := vMSWord.Selection.Range;
Direction := 0;
R.Collapse(Direction);
R.InsertAfter(Title);
R.InsertParagraphAfter;
Separator := ';';
Formata := 30;
R.ConvertToTable(Separator, EmptyParam, EmptyParam,
EmptyParam, Formata, EmptyParam,
EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam);
end;
TMS Scripter will send and error "RUNTIME ERROR -2147417851 Stack content is : [UnicodeString;,,,UnicodeSTring:;...]"
Using var like this change nothing :
MyEmptyVar:=EmptyParam;
R.ConvertToTable(Separator, MyEmptyVar, MyEmptyVar,
MyEmptyVar, Formata, MyEmptyVar,MyEmptyVar, MyEmptyVar,
MyEmptyVar, MyEmptyVar, MyEmptyVar, MyEmptyVar, MyEmptyVar, MyEmptyVar);
Why this script work fine on TMS Scripter version 2.1 (sept 2011)
and not in last version since 6.X.X.X in same Delphi 2010 ?
Best regards,
Fabrice
We have also received a support e-mail about this, we have sent a private e-mail. The code is working here in our setup so we will investigate through e-mail.