|
iWebOffice2004调用VBA脚本解释及翻译(4) var mSheet=gObject.Application.ActiveWorkbook.Sheets(mIndex); mSheet.Protect("", true, true, true); } } if (gUserName == "") { //保存原来的用户 gUserName=gObject.Application.UserName; //设置系统当前用户 gObject.Application.UserName=webform.WebOffice.UserName; } } //打开成功 gOpened = true; } function OnDocumentClosed() { //关闭成功 gOpened = false; } //显示系统状态信息 function StatusMsg(mString){ StatusBar.innerText=mString; } //页面装入事件 function Load(){ //给控件属性付值 try{ webform.WebOffice.WebUrl="<%=mServerUrl%>"; webform.WebOffice.RecordID="<%=mRecordID%>"; webform.WebOffice.Template="<%=mTemplate%>"; webform.WebOffice.FileName="<%=mFileName%>"; webform.WebOffice.FileType="<%=mFileType%>"; webform.WebOffice.EditType="<%=mEditType%>"; webform.WebOffice.UserName="<%=mUserName%>"; //打开文档,执行发送LOADFILE操作 webform.WebOffice.WebOpen(); if (webform.WebOffice.Error!=""){ //如果不成功,执行发送LOADTEMPLATE操作 webform.WebOffice.WebLoadTemplate(); if (webform.WebOffice.Error!=""){ //如果还没有成功,则根据扩展名创建新文档 if (webform.WebOffice.FileType==".doc"){ webform.WebOffice.CreateNew("Word.Document");
|