update two template

This commit is contained in:
csh 2023-06-13 13:27:59 +08:00
parent d08dea6bc9
commit 8f6bdd212b
2 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,6 @@ Begin
str += '"' $ value $ '"'; str += '"' $ value $ '"';
else else
str = str $ value; str = str $ value;
println("str = {}", str);
eval(&str); eval(&str);
TOfficeApi().Set('LastTable', table); TOfficeApi().Set('LastTable', table);
return true; return true;

View File

@ -1,10 +1,14 @@
Function _WordTemplate(alias, fileName); Function _WordTemplate(data, template, fileName);
Begin Begin
setsysparam('data', data);
docx := new TSDocxFile(); docx := new TSDocxFile();
[err, msg] := docx.OpenFile(alias, fileName); [err, msg] := docx.OpenFile('', template);
if err then return false; if err then return false;
docx.ExecInnerTSL(); docx.ExecInnerTSL();
[err, msg] := docx.Save(); if ifstring(fileName) then
begin
[err, msg] := docx.SaveAs('', fileName);
if err then return false; if err then return false;
end
return true; return true;
End; End;