of.html 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. <%@ page contentType="text/html; charset=gb2312" %>
  2. <%@ page import="java.io.*,java.text.*,java.util.*,java.sql.*,java.text.SimpleDateFormat,java.text.DateFormat,java.util.Date,javax.servlet.*,javax.servlet.http.*,DBstep.iDBManager2000.*" %>
  3. <%@page import="java.net.URLDecoder"%>
  4. <%
  5. ResultSet result=null;
  6. String mStatus=null;
  7. String mAuthor=null;
  8. String mFileName=null;
  9. String mFileDate=null;
  10. String mHTMLPath="";
  11. String mDisabled="";
  12. String mDisabledSave="";
  13. String mWord="";
  14. String mExcel="";
  15. //自动获取OfficeServer和OCX文件完整URL路径
  16. String mHttpUrlName=request.getRequestURI();
  17. String mScriptName=request.getServletPath();
  18. String mServerName="OfficeServer";
  19. String mServerUrl="http://"+request.getServerName()+":"+request.getServerPort()+mHttpUrlName.substring(0,mHttpUrlName.lastIndexOf(mScriptName))+"/"+mServerName;//取得OfficeServer文件的完整URL
  20. String mHttpUrl="http://"+request.getServerName()+":"+request.getServerPort()+mHttpUrlName.substring(0,mHttpUrlName.lastIndexOf(mScriptName))+"/";
  21. String mRecordID=request.getParameter("RecordID");
  22. String mTemplate=request.getParameter("Template");
  23. String mFileType=request.getParameter("FileType");
  24. String mEditType=request.getParameter("EditType");
  25. System.out.println(mEditType);
  26. String mSubject= "";
  27. String mUserName=URLDecoder.decode( request.getParameter("UserName") ,"utf-8"); // new String(request.getParameter("UserName").getBytes("utf-8"));
  28. boolean isNewDocument = false;
  29. //设置编号初始值
  30. if (mRecordID==null){
  31. mRecordID="";
  32. }
  33. //设置编辑状态初始值
  34. if (mEditType==null || mEditType==""){
  35. mEditType="1";
  36. }
  37. //设置文档类型初始值
  38. if (mFileType==null || mFileType==""){
  39. mFileType=".doc";
  40. }
  41. //设置用户名初始值
  42. if (mUserName==null || mUserName==""){
  43. mUserName="金格科技";
  44. }
  45. //设置模板初始值
  46. if (mTemplate==null){
  47. mTemplate="";
  48. }
  49. //打开数据库
  50. DBstep.iDBManager2000 DbaObj=new DBstep.iDBManager2000();
  51. if (DbaObj.OpenConnection()){
  52. String mSql="Select * From Document Where RecordID='"+ mRecordID + "'";
  53. try{
  54. result=DbaObj.ExecuteQuery(mSql);
  55. if (result.next()){
  56. mRecordID=result.getString("RecordID");
  57. mTemplate=result.getString("Template");
  58. mSubject=result.getString("Subject");
  59. mAuthor=result.getString("Author");
  60. mFileDate= DbaObj.getDateString(result.getString("FileDate"));
  61. mStatus=result.getString("Status");
  62. mFileType=result.getString("FileType");
  63. mHTMLPath=result.getString("HTMLPath");
  64. isNewDocument = false;
  65. }
  66. else{
  67. //取得唯一值(mRecordID)
  68. java.util.Date dt=new java.util.Date();
  69. long lg=dt.getTime();
  70. Long ld=new Long(lg);
  71. //初始化值
  72. mRecordID=ld.toString();//保存的是文档的编号,通过该编号,可以在里找到所有属于这条纪录的文档
  73. mTemplate=mTemplate;
  74. mSubject="请输入主题";
  75. mAuthor=mUserName;
  76. mFileDate=DbaObj.GetDateTime();
  77. mStatus="DERF";
  78. mFileType=mFileType;
  79. mHTMLPath="";
  80. isNewDocument = true;
  81. }
  82. result.close();
  83. }
  84. catch(SQLException e){
  85. System.out.println(e.toString());
  86. }
  87. DbaObj.CloseConnection() ;
  88. }
  89. String mWPS="";
  90. if (mEditType.equalsIgnoreCase("0")){
  91. mDisabled="disabled";
  92. mDisabledSave="disabled";
  93. }else{
  94. if (mFileType.equalsIgnoreCase(".doc") || mFileType.equalsIgnoreCase(".docx")){
  95. mWPS ="";
  96. mWord="";
  97. mExcel = "disabled";
  98. }else if(mFileType.equalsIgnoreCase(".wps")){
  99. mWPS ="disabled";
  100. mWord="";
  101. mExcel = "disabled";
  102. }
  103. else if (mFileType.equalsIgnoreCase(".xls")||mFileType.equalsIgnoreCase(".xlsx")){
  104. mWord="disabled";
  105. mWPS ="";
  106. mExcel = "";
  107. }
  108. else{
  109. mDisabled="disabled";
  110. }
  111. }
  112. mFileName=mRecordID + mFileType; //取得完整的文档名称
  113. %>
  114. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  115. <html xmlns="http://www.w3.org/1999/xhtml">
  116. <head>
  117. <title>金格科技-iWebOffice2015智能文档中间件示例程序</title>
  118. <meta http-equiv="X-UA-Compatible" content="IE=9" />
  119. <script src="js/jquery-1.4.2.min.js"></script>
  120. <script src="js/WebOffice.js"></script>
  121. <script type="text/javascript">
  122. $(function(){
  123. var isNotLoad = true;/**公共方法**/
  124. $(".tableAll").click(function(){
  125. if(isNotLoad){
  126. isNotLoad = false;
  127. var noneY = $(this).next().css("display");
  128. $(".tableAll").next().css("display","none");
  129. $(".tableAll").find('td:eq(0)').css({'background-color':'#E6DBEC'});
  130. $(".tableAll").find('span:eq(0)').html('+');
  131. if( noneY== 'none'){
  132. var s = $(this).find('td:eq(0)').html();
  133. $(this).find('td:eq(0)').html(s.replace("+", "-")) ;
  134. $(this).find('td:eq(0)').css({'background-color':'#FFFFFF'});
  135. $(this).next().slideToggle(function(){isNotLoad = true;});
  136. }else{
  137. isNotLoad = true;
  138. }
  139. }
  140. });
  141. var hide = false; //下拉
  142. $("#disPlayNone").click(function(){
  143. if(hide){
  144. $('#showTD').width('204px');
  145. $(this).siblings().css("display", "")
  146. hide = false;
  147. }else{
  148. $('#showTD').width('25px');
  149. $(this).siblings().css("display", "none")
  150. hide = true;
  151. }
  152. });
  153. })
  154. </script>
  155. <link rel='stylesheet' type='text/css' href='css/iWebProduct.css' />
  156. <!-- 以下为2015主要方法 -->
  157. <script type="text/javascript">
  158. var WebOffice = new WebOffice2015(); //创建WebOffice对象
  159. </script>
  160. <script type="text/javascript">
  161. function Load(){
  162. try{
  163. WebOffice.WebUrl="<%=mServerUrl%>"; //WebUrl:系统服务器路径,与服务器文件交互操作,如保存、打开文档,重要文件
  164. WebOffice.RecordID="<%=mRecordID%>"; //RecordID:本文档记录编号
  165. WebOffice.FileName="<%=mFileName%>"; //FileName:文档名称
  166. WebOffice.FileType="<%=mFileType%>"; //FileType:文档类型 .doc .xls
  167. WebOffice.UserName="<%=mUserName%>"; //UserName:操作用户名,痕迹保留需要
  168. WebOffice.AppendMenu("1","打开本地文件(&L)"); //多次给文件菜单添加
  169. WebOffice.AppendMenu("2","保存本地文件(&S)");
  170. WebOffice.AppendMenu("3","-");
  171. WebOffice.AppendMenu("4","打印预览(&C)");
  172. WebOffice.AppendMenu("5","退出打印预览(&E)");
  173. WebOffice.AddCustomMenu(); //一次性多次添加包含二次菜单
  174. WebOffice.Skin('purple'); //设置皮肤
  175. WebOffice.HookEnabled();
  176. WebOffice.SetCaption();
  177. WebOffice.SetUser("<%=mUserName%>");
  178. if(WebOffice.WebOpen()){ //打开该文档 交互OfficeServer 调出文档OPTION="LOADFILE"
  179. WebOffice.setEditType("<%=mEditType%>"); //EditType:编辑类型 方式一 WebOpen之后
  180. WebOffice.VBASetUserName(WebOffice.UserName); //设置用户名
  181. getEditVersion();//判断是否是永中office
  182. WebOffice.AddToolbar();//打开文档时显示手写签批工具栏
  183. WebOffice.ShowCustomToolbar(false);//隐藏手写签批工具栏
  184. StatusMsg(WebOffice.Status);
  185. }
  186. }catch(e){
  187. alert(e.description);
  188. }
  189. }
  190. //作用:保存文档
  191. function SaveDocument(){
  192. if (WebOffice.WebSave()){ //交互OfficeServer的OPTION="SAVEFILE"
  193. document.getElementById("iWebOfficeForm").submit();
  194. return true;
  195. }else{
  196. StatusMsg(WebOffice.Status);
  197. return false;
  198. }
  199. }
  200. //设置页面中的状态值
  201. function StatusMsg(mValue){
  202. try{
  203. document.getElementById('state').innerHTML = mValue;
  204. }catch(e){
  205. return false;
  206. }
  207. }
  208. //作用:获取文档Txt正文
  209. function WebGetWordContent(){
  210. try{
  211. alert(WebOffice.WebObject.ActiveDocument.Content.Text);
  212. }catch(e){alert(e.description);}
  213. }
  214. //作用:写Word内容
  215. function WebSetWordContent(){
  216. var mText=window.prompt("请输入内容:","测试内容");
  217. if (mText==null){
  218. return (false);
  219. }else{
  220. WebOffice.WebObject.ActiveDocument.Application.Selection.Range.Text= mText+"\n";
  221. }
  222. }
  223. //作用:获取文档页数
  224. function WebDocumentPageCount(){
  225. if (WebOffice.FileType==".doc"||WebOffice.FileType==".docx"){
  226. var intPageTotal = WebOffice.WebObject.ActiveDocument.Application.ActiveDocument.BuiltInDocumentProperties(14);
  227. intPageTotal = WebOffice.blnIE()?intPageTotal:intPageTotal.Value();
  228. alert("文档页总数:"+intPageTotal);
  229. }
  230. if (WebOffice.FileType==".wps"){
  231. var intPageTotal = WebOffice.WebObject.ActiveDocument.PagesCount();
  232. alert("文档页总数:"+intPageTotal);
  233. }
  234. }
  235. //作用:显示或隐藏痕迹[隐藏痕迹时修改文档没有痕迹保留] true表示隐藏痕迹 false表示显示痕迹
  236. function ShowRevision(mValue){
  237. if (mValue){
  238. WebOffice.WebShow(true);
  239. StatusMsg("显示痕迹...");
  240. }else{
  241. WebOffice.WebShow(false);
  242. StatusMsg("隐藏痕迹...");
  243. }
  244. }
  245. //接受文档中全部痕迹
  246. function WebAcceptAllRevisions(){
  247. WebOffice.WebObject.ActiveDocument.Application.ActiveDocument.AcceptAllRevisions();
  248. var mCount = WebOffice.WebObject.ActiveDocument.Application.ActiveDocument.Revisions.Count;
  249. if(mCount>0){
  250. return false;
  251. }else{
  252. return true;
  253. }
  254. }
  255. //作用:VBA套红
  256. function WebInsertVBA(){
  257. //画线
  258. try{
  259. var object=WebOffice.WebObject.ActiveDocument;
  260. var myl=object.Shapes.AddLine(100,60,305,60);
  261. var myl1=object.Shapes.AddLine(326,60,520,60);
  262. var myRange=WebOffice.WebObject.ActiveDocument.Range(0,0);
  263. myRange.Select();
  264. var mtext="★";
  265. WebOffice.WebObject.ActiveDocument.Application.Selection.Range.InsertAfter (mtext+"\n");
  266. var myRange=WebOffice.WebObject.ActiveDocument.Paragraphs(1).Range;
  267. myRange.ParagraphFormat.LineSpacingRule =1.5;
  268. myRange.font.ColorIndex=6;
  269. myRange.ParagraphFormat.Alignment=1;
  270. myRange=WebOffice.WebObject.ActiveDocument.Range(0,0);
  271. myRange.Select();
  272. mtext="金格发[2012]154号";
  273. WebOffice.WebObject.ActiveDocument.Application.Selection.Range.InsertAfter (mtext+"\n");
  274. myRange=WebOffice.WebObject.ActiveDocument.Paragraphs(1).Range;
  275. myRange.ParagraphFormat.LineSpacingRule =1.5;
  276. myRange.ParagraphFormat.Alignment=1;
  277. myRange.font.ColorIndex=1;
  278. mtext="金格电子政务文件";
  279. WebOffice.WebObject.ActiveDocument.Application.Selection.Range.InsertAfter (mtext+"\n");
  280. myRange=WebOffice.WebObject.ActiveDocument.Paragraphs(1).Range;
  281. myRange.ParagraphFormat.LineSpacingRule =1.5;
  282. myRange.Font.ColorIndex=6;
  283. myRange.Font.Name="仿宋_GB2312";
  284. myRange.font.Bold=true;
  285. myRange.Font.Size=50;
  286. myRange.ParagraphFormat.Alignment=1;
  287. WebOffice.WebObject.ActiveDocument.PageSetup.LeftMargin=70;
  288. WebOffice.WebObject.ActiveDocument.PageSetup.RightMargin=70;
  289. WebOffice.WebObject.ActiveDocument.PageSetup.TopMargin=70;
  290. WebOffice.WebObject.ActiveDocument.PageSetup.BottomMargin=70;
  291. }catch(e){
  292. alert(e);
  293. }
  294. }
  295. //作用:设置书签值 vbmName:标签名称,vbmValue:标签值 标签名称注意大小写
  296. function SetBookmarks(){
  297. try{
  298. var mText=window.prompt("请输入书签名称和书签值,以','隔开。","例如:book1,book2");
  299. var mValue = mText.split(",");
  300. BookMarkName = mValue[0];
  301. BookMarkValue = mValue[1];
  302. WebOffice.WebSetBookmarks(mValue[0],mValue[1]);
  303. StatusMsg("设置成功");
  304. return true;
  305. }catch(e){
  306. StatusMsg("书签不存在");
  307. return false;
  308. }
  309. }
  310. //打开书签窗口
  311. function WebOpenBookMarks(){
  312. WebOffice.WebOpenBookMarks();
  313. }
  314. //添加书签
  315. function WebAddBookMarks(){//书签名称,书签值
  316. WebOffice.WebAddBookMarks("JK","KingGrid");
  317. }
  318. //定位书签
  319. function WebFindBookMarks(){
  320. WebOffice.WebFindBookMarks("JK");
  321. }
  322. //删除书签
  323. function WebDelBookMarks(){//书签名称,
  324. WebOffice.WebDelBookMarks("JK");//删除书签
  325. }
  326. function DelFile(){
  327. var mFileName = WebOffice.FilePath+WebOffice.FileName;
  328. WebOffice.Close();
  329. WebOffice.WebDelFile(mFileName);
  330. }
  331. //作用:用Excel求和
  332. function WebGetExcelContent(){
  333. if(!WebOffice.WebObject.ActiveDocument.Application.Sheets(1).ProtectContents){
  334. WebOffice.WebObject.ExitExcelEditMode();
  335. WebOffice.WebObject.Activate(true);
  336. WebOffice.WebObject.ActiveDocument.Application.Sheets(1).Select();
  337. WebOffice.WebObject.ActiveDocument.Application.Range("C5").Select();
  338. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "126";
  339. WebOffice.WebObject.ActiveDocument.Application.Range("C6").Select();
  340. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "446";
  341. WebOffice.WebObject.ActiveDocument.Application.Range("C7").Select();
  342. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "556";
  343. WebOffice.WebObject.ActiveDocument.Application.Range("C5:C8").Select();
  344. WebOffice.WebObject.ActiveDocument.Application.Range("C8").Activate();
  345. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)";
  346. WebOffice.WebObject.ActiveDocument.Application.Range("D8").Select();
  347. WebOffice.WebObject.ActiveDocument.application.sendkeys("{ESC}");
  348. StatusMsg(WebOffice.WebObject.ActiveDocument.Application.Range("C8").Text);
  349. }
  350. }
  351. //作用:保护工作表单元
  352. function WebSheetsLock(){
  353. if(!WebOffice.WebObject.ActiveDocument.Application.Sheets(1).ProtectContents){
  354. WebOffice.WebObject.ActiveDocument.Application.Range("A1").Select();
  355. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "产品";
  356. WebOffice.WebObject.ActiveDocument.Application.Range("B1").Select();
  357. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "价格";
  358. WebOffice.WebObject.ActiveDocument.Application.Range("C1").Select();
  359. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "详细说明";
  360. WebOffice.WebObject.ActiveDocument.Application.Range("D1").Select();
  361. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "库存";
  362. WebOffice.WebObject.ActiveDocument.Application.Range("A2").Select();
  363. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "书签";
  364. WebOffice.WebObject.ActiveDocument.Application.Range("A3").Select();
  365. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "毛笔";
  366. WebOffice.WebObject.ActiveDocument.Application.Range("A4").Select();
  367. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "钢笔";
  368. WebOffice.WebObject.ActiveDocument.Application.Range("A5").Select();
  369. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "尺子";
  370. WebOffice.WebObject.ActiveDocument.Application.Range("B2").Select();
  371. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "0.5";
  372. WebOffice.WebObject.ActiveDocument.Application.Range("C2").Select();
  373. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "樱花";
  374. WebOffice.WebObject.ActiveDocument.Application.Range("D2").Select();
  375. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "300";
  376. WebOffice.WebObject.ActiveDocument.Application.Range("B3").Select();
  377. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "2";
  378. WebOffice.WebObject.ActiveDocument.Application.Range("C3").Select();
  379. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "狼毫";
  380. WebOffice.WebObject.ActiveDocument.Application.Range("D3").Select();
  381. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "50";
  382. WebOffice.WebObject.ActiveDocument.Application.Range("B4").Select();
  383. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "3";
  384. WebOffice.WebObject.ActiveDocument.Application.Range("C4").Select();
  385. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "蓝色";
  386. WebOffice.WebObject.ActiveDocument.Application.Range("D4").Select();
  387. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "90";
  388. WebOffice.WebObject.ActiveDocument.Application.Range("B5").Select();
  389. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "1";
  390. WebOffice.WebObject.ActiveDocument.Application.Range("C5").Select();
  391. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "20cm";
  392. WebOffice.WebObject.ActiveDocument.Application.Range("D5").Select();
  393. WebOffice.WebObject.ActiveDocument.Application.ActiveCell.FormulaR1C1 = "40";
  394. //保护工作表
  395. WebOffice.WebObject.ActiveDocument.Application.Range("B2:D5").Select();
  396. WebOffice.WebObject.ActiveDocument.Application.Selection.Locked = false;
  397. WebOffice.WebObject.ActiveDocument.Application.Selection.FormulaHidden = false;
  398. WebOffice.WebObject.ActiveDocument.Application.ActiveSheet.Protect(true,true,true);
  399. StatusMsg("已经保护工作表,只有B2-D5单元格可以修改。");
  400. }
  401. }
  402. //根据当空打开的文档类型保存文档
  403. function WebOpenLocal(){
  404. WebOffice.WebOpenLocal();
  405. //WebOffice.WebDelFile(WebOffice.FilePath+WebOffice.FileName);
  406. //WebOffice.FileType = WebOffice.WebGetDocSuffix();
  407. //WebOffice.FileName = WebOffice.FileName.substring(0,WebOffice.FileName.lastIndexOf("."))+WebOffice.FileType;
  408. //document.getElementById('FileType').value = WebOffice.FileType;
  409. }
  410. //调用模板
  411. function WebUseTemplate(fileName){
  412. var currFilePath;
  413. if(WebOffice.WebAcceptAllRevisions()){//清除正文痕迹的目的是为了避免痕迹状态下出现内容异常问题。
  414. currFilePath = WebOffice.getFilePath(); //获取2015特殊路径
  415. WebOffice.WebSaveLocalFile(currFilePath+WebOffice.iWebOfficeTempName);//将当前文档保存下来
  416. if(WebOffice.DownloadToFile(fileName,currFilePath)){//下载服务器指定的文件
  417. WebOffice.OpenLocalFile(currFilePath+fileName);//打开该文件
  418. if(!WebOffice.VBAInsertFile("Content",currFilePath+WebOffice.iWebOfficeTempName)){//插入文档
  419. StatusMsg("插入文档失败");
  420. return;
  421. }
  422. StatusMsg("模板套红成功");
  423. return;
  424. }
  425. StatusMsg("下载文档失败");
  426. return;
  427. }
  428. StatusMsg("清除正文痕迹失败,套红中止");
  429. }
  430. //手写签批
  431. function HandWriting(){
  432. var penColor=document.getElementById("PenColor").value;
  433. var penWidth=document.getElementById("PenWidth").value;
  434. WebOffice.HandWriting(penColor,penWidth);
  435. }
  436. function getEditVersion(){
  437. var getVersion=WebOffice.getEditVersion(); //获取当前编辑器软件版本
  438. if (getVersion == "YozoWP.exe" || getVersion == "YozoSS.exe") //如果是永中office,隐藏手写功能等
  439. {
  440. document.getElementById("handWriting1").style.display='none';
  441. document.getElementById("handWriting2").style.display='none';
  442. document.getElementById("expendFunction").style.display='none';
  443. document.getElementById("enableCopy1").style.display='none';
  444. document.getElementById("enableCopy2").style.display='none';
  445. document.getElementById("OpenBookMarks").style.display='none';
  446. document.getElementById("areaProtect").style.display='none';
  447. document.getElementById("areaUnprotect").style.display='none';
  448. }else if(getVersion == "WINWORD.EXE" || getVersion == "wps.exe") {
  449. WebOffice.ShowWritingUser(true);
  450. }
  451. }
  452. //全屏
  453. function FullSize(mValue){
  454. WebOffice.FullSize(mValue);
  455. }
  456. //添加区域保护
  457. function WebAreaProtect(){
  458. var mText = window.prompt("请输入书签名称", "KingGrid","");
  459. if(mText!=null) WebOffice.WebAreaProtect(mText);
  460. }
  461. //取消区域保护
  462. function WebAreaUnprotect(){
  463. var mText = window.prompt("请输入书签名称", "KingGrid","");
  464. if(mText!=null) WebOffice.WebAreaUnprotect(mText);
  465. }
  466. //执行宏命令
  467. function WebRunMacro(){
  468. window.open("MacroForm.htm",'','height=250px,width=450px,top=300,left=350,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
  469. }
  470. </script>
  471. <script language="javascript" for="WebOffice2015" event="OnReady()">
  472. WebOffice.setObj(document.getElementById('WebOffice2015'));//给2015对象赋值
  473. Load();//避免页面加载完,控件还没有加载情况
  474. </script>
  475. <script language="javascript" for="WebOffice2015" event="OnRightClickedWhenAnnotate()">
  476. WebOffice.ShowToolBars(true);//停止签批时显示工具栏
  477. WebOffice.ShowMenuBar(true);//停止签批时显示菜单栏
  478. </script>
  479. <script language="JavaScript" for=WebOffice2015 event="OnFullSizeBefore(bVal)">
  480. if(bVal == true){
  481. var getVersion=WebOffice.getEditVersion();
  482. if(getVersion == "WINWORD.EXE" || getVersion == "wps.exe") {
  483. WebOffice.ShowCustomToolbar(true);//显示手写签批工具栏
  484. }
  485. }
  486. </script>
  487. <script language="JavaScript" for=WebOffice2015 event="OnFullSizeAfter(bVal)">
  488. if(bVal == false){
  489. WebOffice.ShowCustomToolbar(false); //隐藏控件的手写签批工具栏
  490. }
  491. </script>
  492. <script language="javascript" for=WebOffice2015 event="OnRecvStart(nTotleBytes)">
  493. nSendTotleBytes = nTotleBytes;
  494. nSendedSumBytes = 0;
  495. </script>
  496. <script language="javascript" for=WebOffice2015 event="OnRecving(nRecvedBytes)">
  497. nSendedSumBytes += nRecvedBytes;
  498. </script>
  499. <script language="javascript" for=WebOffice2015 event="OnRecvEnd(bSucess)">
  500. </script>
  501. <script language="javascript" for=WebOffice2015 event="OnSendStart(nTotleBytes)">
  502. nSendTotleBytes = nTotleBytes;
  503. nSendedSumBytes = 0;
  504. </script>
  505. <script language="javascript" for=WebOffice2015 event="OnSending(nSendedBytes)">
  506. nSendedSumBytes += nSendedBytes;
  507. </script>
  508. <script language="javascript" for=WebOffice2015 event="OnSendEnd(bSucess)">
  509. if (bSucess){
  510. if(WebOffice.sendMode == "LoadImage"){
  511. var httpclient = WebOffice.WebObject.Http;
  512. WebOffice.hiddenSaveLocal(httpclient,WebOffice,false,false,WebOffice.ImageName);
  513. WebOffice.InsertImageByBookMark();
  514. WebOffice.ImageName = null;
  515. WebOffice.BookMark = null;
  516. StatusMsg("插入图片成功");
  517. return
  518. }
  519. StatusMsg("插入图片失败");
  520. }
  521. </script>
  522. <script language="JavaScript" for=WebOffice2015 event="OnCommand(ID, Caption, bCancel)">
  523. switch(ID){
  524. case 1:WebOpenLocal();break;//打开本地文件
  525. case 2:WebOffice.WebSaveLocal();break;//另存本地文件
  526. case 4:WebOffice.PrintPreview();break;//启用
  527. case 5:WebOffice.PrintPreviewExit();WebOffice.ShowField();break;//启用
  528. case 17:WebOffice.SaveEnabled(true);StatusMsg("启用保存");break;//启用保存
  529. case 18:WebOffice.SaveEnabled(false);StatusMsg("关闭保存");break;//关闭保存
  530. case 19:WebOffice.PrintEnabled(true);StatusMsg("启用打印");break;//启用打印
  531. case 20:WebOffice.PrintEnabled(false);StatusMsg("关闭打印");break;//关闭打印
  532. case 301:WebOffice.HandWriting("255","4");StatusMsg("手写签批");break;//手写签批
  533. case 302:WebOffice.StopHandWriting();StatusMsg("停止手写签批");break;//停止手写签批
  534. case 303:WebOffice.TextWriting();StatusMsg("文字签名");break;//文字签名
  535. case 304:WebOffice.ShapeWriting();StatusMsg("图形签批");break;//图形签批
  536. case 305:WebOffice.RemoveLastWriting();StatusMsg("取消上一次签批");break;//取消上一次签批
  537. case 306:WebOffice.ShowWritingUser(false,WebOffice.UserName);StatusMsg("显示签批用户");break;//显示签批用户
  538. default:;return;
  539. }
  540. </script>
  541. <script language="javascript" for=WebOffice2015 event="OnQuit()">
  542. //DelFile();
  543. </script>
  544. <!--以下是多浏览器的事件方法 -->
  545. <script >
  546. function OnReady(){
  547. WebOffice.setObj(document.getElementById('WebOffice2015'));//给2015对象赋值
  548. //Load();//避免页面加载完,控件还没有加载情况
  549. window.onload = function(){Load();} //IE和谷歌可以直接调用Load方法,火狐要在页面加载完后去调用
  550. }
  551. //停止签批时显示工具栏和菜单栏
  552. function OnRightClickedWhenAnnotate(){
  553. WebOffice.ShowToolBars(true);
  554. WebOffice.ShowMenuBar(true);
  555. }
  556. //全屏显示控件的手写签批工具栏
  557. function OnFullSizeBefore(bVal){
  558. if(bVal == true){
  559. var getVersion=WebOffice.getEditVersion();
  560. if(getVersion == "WINWORD.EXE" || getVersion == "wps.exe") {
  561. WebOffice.ShowCustomToolbar(true);//显示手写签批工具栏
  562. }
  563. }
  564. }
  565. //退出全屏隐藏控件的手写签批工具栏
  566. function OnFullSizeAfter(bVal){
  567. if(bVal == false){
  568. WebOffice.ShowCustomToolbar(false);
  569. }
  570. }
  571. //上传下载回调用事件
  572. function OnSendStart(nTotleBytes){
  573. nSendTotleBytes = nTotleBytes;nSendedSumBytes = 0;
  574. }
  575. function OnSending(nSendedBytes){
  576. nSendedSumBytes += nSendedBytes;
  577. }
  578. //异步上传
  579. function OnSendEnd() {
  580. if(WebOffice.sendMode == "LoadImage"){
  581. var httpclient = WebOffice.WebObject.Http;
  582. WebOffice.hiddenSaveLocal(httpclient,WebOffice,false,false,WebOffice.ImageName);
  583. WebOffice.InsertImageByBookMark();
  584. WebOffice.ImageName = null;
  585. WebOffice.BookMark = null;
  586. StatusMsg("插入图片成功");
  587. return;
  588. }
  589. StatusMsg("插入图片失败");
  590. }
  591. function OnRecvStart(nTotleBytes){
  592. nSendTotleBytes = nTotleBytes;nSendedSumBytes = 0;
  593. }
  594. function OnRecving(nRecvedBytes){
  595. nSendedSumBytes += nRecvedBytes;
  596. }
  597. //异步下载
  598. function OnRecvEnd() {
  599. }
  600. function OnCommand(ID, Caption, bCancel){
  601. switch(ID){
  602. case 1:WebOpenLocal();break;//打开本地文件
  603. case 2:WebOffice.WebSaveLocal();break;//另存本地文件
  604. case 4:WebOffice.PrintPreview();break;//启用
  605. case 5:WebOffice.PrintPreviewExit();WebOffice.ShowField();break;//启用
  606. case 17:WebOffice.SaveEnabled(true);StatusMsg("启用保存");break;//启用保存
  607. case 18:WebOffice.SaveEnabled(false);StatusMsg("关闭保存");break;//关闭保存
  608. case 19:WebOffice.PrintEnabled(true);StatusMsg("启用打印");break;//启用打印
  609. case 20:WebOffice.PrintEnabled(false);StatusMsg("关闭打印");break;//关闭打印
  610. case 301:WebOffice.HandWriting("255","4");StatusMsg("手写签批");break;//手写签批
  611. case 302:WebOffice.StopHandWriting();StatusMsg("停止手写签批");break;//停止手写签批
  612. case 303:WebOffice.TextWriting();StatusMsg("文字签名");break;//文字签名
  613. case 304:WebOffice.ShapeWriting();StatusMsg("图形签批");break;//图形签批
  614. case 305:WebOffice.RemoveLastWriting();StatusMsg("取消上一次签批");break;//取消上一次签批
  615. case 306:WebOffice.ShowWritingUser(false,WebOffice.UserName);StatusMsg("显示签批用户");break;//显示签批用户
  616. default:;return;
  617. }
  618. }
  619. </script>
  620. <!--End以下是多浏览器的事件方法 -->
  621. <!--End 为2015主要方法 -->
  622. </head>
  623. <body onresize="init()" style="overflow-y:hidden;overflow-x:hidden" onUnload="WebOffice.WebClose()">
  624. <table id="maintable" cellspacing='0' cellpadding='0' >
  625. <!-- head -->
  626. <tr><td colspan="2" height="61px"><table cellspacing='0' cellpadding='0' cellspacing='0' cellpadding='0' id="header"><tr ><td ><img src="css/logo.jpg"/></td><td><span> iWebOffice2015</span> 在线管理中间件示例程序</td></tr></table></td></tr>
  627. <tr><td height="34px" class="title" width="80%">
  628. <span>主题:<input type=text name="Subject1" id="Subject1" onchange=" document.getElementById('Subject').value = this.value;" value="<%=mSubject %>" class="InputLine2" onblur="if(this.value.length>20){this.value='请输入主题';StatusMsg('主题不能超过50个字');}"/> </span>
  629. <span style="margin-left: 50px;">作者:<input type=text onchange=" document.getElementById('Author').value = this.value;" name="Author1" id="Author1" value="<%=mUserName %>" class="InputLine2" onblur="if(this.value.length>8){this.value='体验用户';StatusMsg('作者不能超过8个字');}" /></span>
  630. </td>
  631. <td class="title"><span><a href="#" onclick="SaveDocument()">保存文档</a></span><span><a href="#" onclick="window.opener.location.reload();window.close()">返回列表</a></span></td>
  632. </tr>
  633. <!-- end head -->
  634. <!-- showList -->
  635. <tr><td id="showtr" colspan="2" valign="top">
  636. <table id="functionBox" border="0">
  637. <tr>
  638. <td id="showTD" width="204px" height="30px" valign="top">
  639. <table id="functionTable" cellspacing='4' cellpadding='0' >
  640. <tr id="disPlayNone"><td height="30px" class="tableFather" > 功能列表&lt; </td></tr>
  641. <tr id="handWriting2" class="<%=mDisabled+mWord%>" class="test"><td valign="middle" class="tableFather">
  642. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle">签批  <span>+</span></td></tr></table>
  643. <div id="read8" class="hideDiv">
  644. <table id="readT8" width="100%" cellspacing='0' cellpadding='0'><!-- 附加功能示例子菜单 -->
  645. <tr><td class="dot-size"><a href="#" onClick="HandWriting();">手写签名</a></td></tr>
  646. <tr><td class="dot-size"><a href="#" onClick="WebOffice.StopHandWriting();">停止签批</a></td></tr>
  647. <tr><td class="dot-size"><a href="#" onClick="WebOffice.TextWriting();">文字签名</a></td></tr>
  648. <tr><td class="dot-size"><a href="#" onClick="WebOffice.ShapeWriting();">图形签名</a></td></tr>
  649. <tr><td class="dot-size"><a href="#" onClick="WebOffice.RemoveLastWriting();">返回上一次</a></td></tr>
  650. <tr><td class="dot-size"><a href="#" onClick="WebOffice.ShowWritingUser(false,WebOffice.UserName);">显示当前用户签批</a></td></tr>
  651. </table><!--END 附加功能示例能子菜单 -->
  652. </div>
  653. </td></tr>
  654. <tr class="test"><td valign="middle" class="tableFather">
  655. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 文件  <span>+</span></td></tr></table>
  656. <div id="read0" class="hideDiv" >
  657. <table id="readT0" width="100%" cellspacing='0' cellpadding='0'><!-- 文档阅读功能子菜单 -->
  658. <tr <%=mEditType.equalsIgnoreCase("0")?"class=\"disabled\"":""%>><td class="dot-size"><a href="#" onclick='WebOffice.CreateFile();'>新建文件</a></td></tr>
  659. <tr <%=mEditType.equalsIgnoreCase("0")?"class=\"disabled\"":""%>><td class="dot-size"><a href="#" onclick="WebOpenLocal();">打开本地文件</a></td></tr>
  660. <tr><td class="dot-size"><a href="#" onClick="WebOffice.WebSaveLocal();">另存为</a> <!--true禁止,false启用--></td></tr>
  661. <tr <%=mEditType.equalsIgnoreCase("0")?"class=\"disabled\"":""%>><td class="dot-size"><a href="#" onClick="WebOffice.WebPageSetup()">页面设置</a> <!--true显示,false隐藏--></td></tr>
  662. <tr><td class="dot-size"><a href="#" onClick="WebOffice.WebOpenPrint()">打印文档</a> <!--true显示,false隐藏--></td></tr>
  663. <tr><td class="dot-size"><a href="#" onClick="alert('当前控件版本为:'+WebOffice.Version());">显示版本</a> <!--true显示,false隐藏--></td></tr>
  664. <tr><td class="dot-size"><a href="#" onClick="WebOffice.Close()">关闭文档</a> <!--true显示,false隐藏--></td></tr>
  665. </table><!--END 文档阅读功能子菜单 -->
  666. </div>
  667. </td></tr>
  668. <tr class="<%=mDisabled+mWord%>" class="test" ><td valign="middle" class="tableFather">
  669. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 插入  <span>+</span></td></tr></table>
  670. <div id="read1" class="hideDiv">
  671. <table id="readT1" width="100%" cellspacing='0' cellpadding='0'><!-- 文档制功能子菜单 -->
  672. <tr class="<%=mDisabled+mWord%>"><td class="dot-size" ><a href="#" <%=mDisabled%> onClick="WebOffice.WebInsertImage('image','GoldgridLogo.jpg');">插入远程图片</a></td></tr>
  673. <tr class="<%=mDisabled+mWord%>"><td class="dot-size" ><a href="#" <%=mDisabled%> onClick="WebGetWordContent();">取Word内容</a></td></tr>
  674. <tr class="<%=mDisabled+mWord%>"><td class="dot-size" ><a href="#" <%=mDisabled%> onClick="WebSetWordContent();">写Word内容</a></td></tr>
  675. <tr class="<%=mDisabled+mWord%>"><td class="dot-size"><a href="#" <%=mDisabled%> onClick="WebOffice.WebObject.ActiveDocument.ActiveWindow.ActivePane.View.SeekView=9;">插入页眉</a></td></tr>
  676. <tr class="<%=mDisabled+mWord%>"><td class="dot-size"><a href="#" <%=mDisabled%> onClick="WebOffice.WebPageCode()">插入页码</a></td></tr>
  677. <tr class="<%=mDisabled+mWord%>"><td class="dot-size"><a href="#" onclick="WebDocumentPageCount();">文档页数</a></td></tr>
  678. <tr class="<%=mDisabled+mWord%>"><td class="dot-size"><a href="#" onclick="WebInsertVBA();">VBA套红定稿</a></td></tr>
  679. </table><!--END 文档控制功能子菜单 -->
  680. </div>
  681. </td></tr>
  682. <%if(mWord.equalsIgnoreCase("disabled")){ %>
  683. <tr class="test" ><td valign="middle" class="tableFather">
  684. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 插入  <span>+</span></td></tr></table>
  685. <div id="read8" class="hideDiv">
  686. <table id="readT8" width="100%" cellspacing='0' cellpadding='0'><!-- 文档制功能子菜单 -->
  687. <tr class="<%=mDisabled+mExcel%>"><td class="dot-size"><a href="#" onClick="WebGetExcelContent();">用Excel求和</a></td></tr>
  688. <tr class="<%=mDisabled+mExcel%>"><td class="dot-size"><a href="#" onClick="WebSheetsLock();">锁定工作表</a></td></tr>
  689. </table><!--END 文档控制功能子菜单 -->
  690. </div>
  691. </td></tr>
  692. <%} %>
  693. <tr class="<%=mDisabled+mWord%>" class="test" ><td valign="middle" class="tableFather">
  694. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 痕迹  <span>+</span></td></tr></table>
  695. <div id="read2" class="hideDiv">
  696. <table id="readT2" width="100%" cellspacing='0' cellpadding='0'><!-- 文档制功能子菜单 -->
  697. <tr class="<%=mDisabled+mWord%>" style="height:30px"><td class="dot-size"><a href="#" style="height:30px" <%=mDisabled%> onClick="ShowRevision(true)">显示痕迹</a></td></tr>
  698. <tr class="<%=mDisabled+mWord%>" style="height:30px"><td class="dot-size"><a href="#" style="height:30px" <%=mDisabled%> onClick="ShowRevision(false)">隐藏痕迹</a></td></tr>
  699. <tr class="<%=mDisabled+mWord%>" style="height:30px"><td class="dot-size"><a href="#" style="height:30px" <%=mDisabled%> onClick="WebAcceptAllRevisions()">清除痕迹</a></td></tr>
  700. </table><!--END 文档控制功能子菜单 -->
  701. </div>
  702. </td></tr>
  703. <tr class="test"><td valign="middle" class="tableFather">
  704. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 视图  <span>+</span></td></tr></table>
  705. <div id="read3" class="hideDiv">
  706. <table id="readT3" width="100%" cellspacing='0' cellpadding='0'><!-- 附加功能示例子菜单 -->
  707. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowTitleBar(true)">显示标题栏</a></td></tr>
  708. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowTitleBar(false)">隐藏标题栏</a></td></tr>
  709. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowMenuBar(true);">显示菜单栏</a></td></tr>
  710. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowMenuBar(false);">隐藏菜单栏</a></td></tr>
  711. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowToolBars(true)">显示工具栏</a></td></tr>
  712. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowToolBars(false)">隐藏工具栏</a></td></tr>
  713. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowStatusBar(true)">显示状态栏</a></td></tr>
  714. <tr><td class="dot-size"><a href="#" onclick="WebOffice.ShowStatusBar(false)">隐藏状态栏</a></td></tr>
  715. <tr><td class="dot-size"><a href="#" onclick="FullSize(true)">全屏切换</a></td></tr>
  716. </table><!--END 附加功能示例能子菜单 -->
  717. </div>
  718. </td>
  719. </tr>
  720. <tr class="<%=mDisabled+mWord%>" class="test"><td valign="middle" class="tableFather">
  721. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 权限  <span>+</span></td></tr></table>
  722. <div id="read4" class="hideDiv">
  723. <table id="readT4" width="100%" cellspacing='0' cellpadding='0'><!-- 附加功能示例子菜单 -->
  724. <tr><td class="dot-size"><a href="#" onclick="WebOffice.WebSetProtect(true,'123')">保护文档</a></td></tr>
  725. <tr><td class="dot-size"><a href="#" onclick="WebOffice.WebSetProtect(false,'123')">解除保护</a></td></tr>
  726. <tr id="enableCopy1"><td class="dot-size"><a href="#" onclick="WebOffice.WebEnableCopy(true)">允许拷贝</a></td></tr>
  727. <tr id="enableCopy2"><td class="dot-size"><a href="#" onclick="WebOffice.WebEnableCopy(false)">禁止拷贝</a></td></tr>
  728. <tr id="areaProtect"><td class="dot-size"><a href="#" onclick="WebAreaProtect()">添加区域保护</a></td></tr>
  729. <tr id="areaUnprotect"><td class="dot-size"><a href="#" onclick="WebAreaUnprotect()">取消区域保护</a></td></tr>
  730. </table><!--END 附加功能示例能子菜单 -->
  731. </div>
  732. </td></tr>
  733. <tr class="<%=mDisabled+mWord%>" class="test" ><td valign="middle" class="tableFather">
  734. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 模板  <span>+</span></td></tr></table>
  735. <div id="read5" class="hideDiv">
  736. <table id="readT5" width="100%" cellspacing='0' cellpadding='0'><!-- 文档制功能子菜单 -->
  737. <tr class="<%=mDisabled+mWord%>"><td class="dot-size"><a href="#" <%=mDisabled%> onClick="WebUseTemplate('Temone.doc')">模板套红一</a></td></tr>
  738. <tr class="<%=mDisabled+mWord%>"><td class="dot-size"><a href="#" <%=mDisabled%> onClick="WebUseTemplate('Temtwo.doc')">模板套红二</a></td></tr>
  739. </table><!--END 文档控制功能子菜单 -->
  740. </div>
  741. </td></tr>
  742. <tr class="<%=mDisabled+mWord%>" class="test" ><td valign="middle" class="tableFather">
  743. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 书签  <span>+</span></td></tr></table>
  744. <div id="read6" class="hideDiv">
  745. <table id="readT6" width="100%" cellspacing='0' cellpadding='0'><!-- 附加功能示例子菜单 -->
  746. <tr><td class="dot-size"><a href="#" onClick="SetBookmarks();">书签填充</a></td></tr>
  747. <tr id="OpenBookMarks"><td class="dot-size"><a href="#" onClick="WebOpenBookMarks();">打开书签窗体</a></td></tr>
  748. <tr><td class="dot-size"><a href="#" onClick="WebAddBookMarks();">添加书签</a></td></tr>
  749. <tr><td class="dot-size"><a href="#" onClick="WebFindBookMarks();">定位书签</a></td></tr>
  750. <!-- <tr><td class="dot-size"><a href="#" onClick="WebDelBookMarks();">删除书签</a></td></tr> -->
  751. </table><!--END 附加功能示例能子菜单 -->
  752. </div>
  753. </td></tr>
  754. <tr class="test" ><td valign="middle" class="tableFather">
  755. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 皮肤  <span>+</span></td></tr></table>
  756. <div id="read7" class="hideDiv">
  757. <table id="readT7" width="100%" cellspacing='0' cellpadding='0'><!-- 附加功能示例子菜单 -->
  758. <tr><td class="dot-size"><a href="#" onClick="WebOffice.Skin('purple');"> 紫色</a></td></tr>
  759. <tr><td class="dot-size"><a href="#" onClick="WebOffice.Skin('black');"> 黑色</a></td></tr>
  760. <tr><td class="dot-size"><a href="#" onClick="WebOffice.Skin('white');"> 银色</a></td></tr>
  761. <tr><td class="dot-size"><a href="#" onClick="WebOffice.Skin('blue');"> 蓝色</a></td></tr>
  762. <tr><td class="dot-size"><a href="#" onClick="WebOffice.Skin('yellow');"> 金黄色</a></td></tr>
  763. </table><!--END 附加功能示例能子菜单 -->
  764. </div>
  765. </td></tr>
  766. <tr id="expendFunction" class="<%=mDisabled+mWord%>" class="test" ><td valign="middle" class="tableFather">
  767. <table class="tableAll" cellspacing='0' style="height:30px" cellpadding='0'><tr><td class="titleStyle"> 扩展功能  <span>+</span></td></tr></table>
  768. <div id="read9" class="hideDiv">
  769. <table id="readT9" width="100%" cellspacing='0' cellpadding='0'><!-- 附加功能示例子菜单 -->
  770. <tr><td class="dot-size"><a href="#" onClick="WebOffice.WebSavePDF();">保存为PDF </a></td></tr>
  771. <tr><td class="dot-size"><a href="#" onClick="WebOffice.WebSaveHtml();">保存为本地html</a></td></tr>
  772. <tr class="<%=mDisabled+mWord+mWPS%>"><td class="dot-size"><a href="#" onClick="WebRunMacro();">运行宏</a></td></tr>
  773. </table><!--END 附加功能示例能子菜单 -->
  774. </div>
  775. </td></tr>
  776. <tr><td>&nbsp;</td></tr>
  777. <tr>
  778. <td style="border: 0">&nbsp;
  779. <form id="iWebOfficeForm" method="post" action="DocumentSave.jsp" >
  780. <input type="hidden" name="RecordID" value="<%=mRecordID%>"/>
  781. <input type="hidden" name="Template" value="<%=mTemplate%>"/>
  782. <input type="hidden" id="FileType" name="FileType" value="<%=mFileType%>"/>
  783. <input type="hidden" name="EditType" value="<%=mEditType%>"/>
  784. <input type="hidden" name="HTMLPath" value="<%=mHTMLPath%>"/>
  785. <input type="hidden" id="Subject" name="Subject" value="<%=mSubject%>"/>
  786. <input type="hidden" id="Author" name="Author" value="<%=mAuthor%>"/>
  787. <input type="hidden" name="FileDate" value="<%=mFileDate%>"/>
  788. </form></td>
  789. </tr>
  790. </table>
  791. </td>
  792. <td id="activeBox">
  793. <table id="activeTable">
  794. <tr id="handWriting1" class="<%=mDisabled+mWord%>">
  795. <td class="handWriting" style="width:8%">手写批注颜色:</font></td>
  796. <td style="width:7%"><select id="PenColor">
  797. <option value="255" selected="selected">红色</option>
  798. <option value="16711680" >蓝色</option>
  799. <option value="65535" >黄色</option>
  800. <option value="0" >黑色</option>
  801. <option value="32768" >绿色</option>
  802. </select></td>
  803. <td class="handWriting" style="width:8%">手写批注笔宽:</td>
  804. <td style="width:7%"><select id="PenWidth">
  805. <option value="1">一线</option>
  806. <option value="2">二线</option>
  807. <option value="3">三线</option>
  808. <option value="4" selected="selected">四线</option>
  809. <option value="5">五线</option>
  810. <option value="6">六线</option>
  811. <option value="7">七线</option>
  812. <option value="8">八线</option>
  813. </select>
  814. </td>
  815. <td style="width:10%"><input type="button" value="手写签批" class="hand2" onclick="HandWriting();"/></td>
  816. <td style="width:10%"><input type="button" value="停止签批" class="hand2" onclick="WebOffice.StopHandWriting();"/></td>
  817. <td style="width:10%"><input type="button" value="返回上一次" class="hand2" onclick="WebOffice.RemoveLastWriting();"/></td>
  818. <td class="handhint" style="width:40%"></>温馨提示:鼠标右健可停止签批!</td>
  819. </tr>
  820. <tr>
  821. <td colspan="8" id="activeTd" >&nbsp;<script src="js/iWebOffice2015.js"></script></td>
  822. </tr>
  823. <tr>
  824. <td colspan="6" height="10px" align="left" class="statue">状态:<span id="state"></span></td>
  825. <td colspan="2" align="right" style="time">时间:<%=mFileDate%></td>
  826. </tr>
  827. </table>
  828. </td>
  829. </tr>
  830. </table>
  831. </td></tr>
  832. <!-- end showList -->
  833. <!-- footer -->
  834. <tr ><td colspan="2" height="30px" class="footer"><table><tr><td align="center">江西金格科技股份有限公司 版权所有</td></tr></table></td></tr>
  835. <!-- end footer -->
  836. </table>
  837. </body>
  838. </html>
  839. <script language="javascript">
  840. self.moveTo(0,0);
  841. self.resizeTo(screen.availWidth,screen.availHeight);
  842. init();
  843. function init(){
  844. document.getElementById('WebOffice2015').height =document.documentElement.clientHeight- 160 +"px";
  845. var functionTableLength = getHeight('showTD')-document.getElementById("functionTable").rows.length*32;
  846. for(var i =0;i<document.getElementById("functionTable").rows.length-3;i++){
  847. try{
  848. var readivLength = document.getElementById("readT"+i).rows.length*30;
  849. if(readivLength+30 < functionTableLength){
  850. document.getElementById('readT'+i).style.height = readivLength+ 8 + "px";
  851. document.getElementById('read'+i).style.height = readivLength+ 8 + "px";
  852. }else{
  853. document.getElementById('readT'+i).style.height = functionTableLength-50 + "px";
  854. document.getElementById('read'+i).style.height = functionTableLength -50 + "px";
  855. }
  856. }catch(e){
  857. continue;
  858. }
  859. }
  860. $("tr").remove(".disabled");
  861. }
  862. //获取id的高度
  863. function getHeight(id){
  864. return document.getElementById(id).offsetHeight;
  865. }
  866. </script>