-- 作者:z7c9
-- 发布时间:2013/10/22 21:46:36
-- [原创]导入导出全局变量
dim appname dim filename
appname="weistock" filename="c:\\weistock.csv"
sub exportgbdata() set fso=createobject("scripting.filesystemobject") set file=fso.opentextfile(filename,2,true) for i=0 to document.ExtDataNum-1 value=document.GetExtDataByIndex(i,key) file.writeline(key&","&value&","&"数字") next for i=0 to document.ExtDataStringNum-1 value=document.GetExtStringByIndex(i,key) file.writeline(key&","&value&","&"字符串") next file.close
end sub
sub importgbdata() set fso=createobject("scripting.filesystemobject") set file=fso.opentextfile(filename,1,true) while file.atendofline<>true line=file.readline dim array array=split(line,",") if array(2)="数字" then document.SetExtData array(0),array(1) elseif array(2)="字符串" then document.SetExtString array(0),array(1) end if wend file.close
end sub
[此贴子已经被作者于2013/10/22 21:47:49编辑过]
|