v1.3.3
This commit is contained in:
parent
ce331f4417
commit
f46240850e
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
|||
// Version 1.3.3
|
||||
// Version 1.3.4
|
||||
|
||||
Function TOfficeObj(n);
|
||||
Begin
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Version 1.3.3
|
||||
// Version 1.3.4
|
||||
|
||||
Type TSDocxFile = Class
|
||||
///Version: V1.0 2022-09-20
|
||||
|
|
@ -18,7 +18,17 @@ Type TSDocxFile = Class
|
|||
Function Create(alias, fname); overload;
|
||||
Begin
|
||||
init();
|
||||
OpenFile(alias, fname);
|
||||
OpenFile(alias, fname, nil);
|
||||
End;
|
||||
|
||||
///构造函数,打开已经存在的docx文件
|
||||
///alias: string,文件目录别名
|
||||
///fname: string,文件名
|
||||
///passwd: string,密码
|
||||
Function Create(alias, fname, passwd); overload;
|
||||
Begin
|
||||
init();
|
||||
OpenFile(alias, fname, passwd);
|
||||
End;
|
||||
|
||||
Function Destory();
|
||||
|
|
@ -34,11 +44,12 @@ Type TSDocxFile = Class
|
|||
///打开docx文件
|
||||
///alias: string,文件目录别名
|
||||
///fname: string,文件名
|
||||
///[passwd]: string,密码
|
||||
///返回:[err, errmsg]
|
||||
Function OpenFile(alias, fname);
|
||||
Function OpenFile(alias, fname, passwd);
|
||||
Begin
|
||||
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
||||
[err, errmsg] := zipfile_.Open(alias, fname);
|
||||
[err, errmsg] := zipfile_.Open(alias, fname, passwd);
|
||||
if err=0 then Begin
|
||||
document_ := new docxDocument(zipfile_);
|
||||
End;
|
||||
|
|
@ -56,6 +67,12 @@ Type TSDocxFile = Class
|
|||
End;
|
||||
return array(err, errmsg);
|
||||
End;
|
||||
|
||||
///设置密码
|
||||
Function SetPassword(passwd)
|
||||
Begin
|
||||
if not ifnil(passwd) then zipfile_.Password := passwd;
|
||||
End;
|
||||
|
||||
///保存文件
|
||||
///返回: [err, info]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Version 1.3.3
|
||||
// Version 1.3.4
|
||||
|
||||
Type TSExcelFile = Class
|
||||
///Version: V1.0 2022-08-08
|
||||
|
|
@ -18,7 +18,17 @@ Type TSExcelFile = Class
|
|||
Function Create(alias, fname); overload;
|
||||
Begin
|
||||
init();
|
||||
OpenFile(alias, fname);
|
||||
OpenFile(alias, fname, nil);
|
||||
End;
|
||||
|
||||
///构造函数,打开已经存在的excel文件
|
||||
///alias: string,文件目录别名
|
||||
///fname: string,文件名
|
||||
///passwd: string,密码
|
||||
Function Create(alias, fname, passwd); overload;
|
||||
Begin
|
||||
init();
|
||||
OpenFile(alias, fname, passwd);
|
||||
End;
|
||||
|
||||
//析构函数
|
||||
|
|
@ -35,12 +45,13 @@ Type TSExcelFile = Class
|
|||
///打开excel文件
|
||||
///alias: string,文件目录别名
|
||||
///fname: string,文件名
|
||||
///[passwd]: string,密码
|
||||
///返回: [err, errmsg]
|
||||
Function OpenFile(alias, fname);
|
||||
Function OpenFile(alias, fname, passwd);
|
||||
Begin
|
||||
init();
|
||||
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
||||
[err, errmsg] := zipfile_.Open(alias, fname);
|
||||
[err, errmsg] := zipfile_.Open(alias, fname, passwd);
|
||||
if err=0 then Begin
|
||||
workbook_ := new xlsxWorkBook(zipfile_);
|
||||
workbook_.Load();
|
||||
|
|
@ -69,6 +80,12 @@ Type TSExcelFile = Class
|
|||
return zipfile_.Save();
|
||||
End;
|
||||
|
||||
///设置密码
|
||||
Function SetPassword(passwd)
|
||||
Begin
|
||||
if not ifnil(passwd) then zipfile_.Password := passwd;
|
||||
End;
|
||||
|
||||
///打开二进制内容
|
||||
///data: 二进制数据
|
||||
///返回: [err, errmsg]
|
||||
|
|
|
|||
Loading…
Reference in New Issue