WordPageForOnlyRead.aspx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:8k
源码类别:

.net编程

开发平台:

C#

  1. <%@ page language="C#" autoeventwireup="true" inherits="Workflow_WordPageForOnlyRead, App_Web_-rs7x2pk" theme="Normal" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head id="Head1" runat="server">
  5. <title>基于WebForms的操作Word</title>
  6. <meta name="GENERATOR" content="Microsoft Visual Studio 7.0"/>
  7. <meta name="CODE_LANGUAGE" content="C#"/>
  8. <meta name="vs_defaultClientScript" content="JavaScript"/>
  9. <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"/>
  10. </head>
  11. <body style="background-color:#ffffff;"  onload="soaOpen();window.focus();" onunload="soaClose();">
  12. <script type="text/javascript">
  13.     var bDocOpen = false;
  14. function soaOpen() 
  15. {
  16.  var mHttpUrl=location.href;
  17.          var mScriptName = "DaiBan.aspx?strFName";
  18.          var a= mHttpUrl.split('=');
  19.          var sfname="";
  20.  for (var i=0;i<a.length;i++)
  21.  {
  22.     switch (i)
  23.     {
  24.         case 0:
  25.             break;
  26.         case 1:
  27.             sfname = a[i];
  28.             break;
  29.         default:
  30.             break;
  31.      }
  32.          }
  33. try {
  34. formData.SOAOfficeCtrl.UserMenuCaption = "自定义菜单(&N)";
  35. formData.SOAOfficeCtrl.AppendMenuItem(1, "显示痕迹(&S)", false);
  36. formData.SOAOfficeCtrl.AppendMenuItem(2, "隐藏痕迹(&H)", false);
  37. formData.SOAOfficeCtrl.AppendMenuItem(3, "-");
  38. formData.SOAOfficeCtrl.AppendMenuItem(4, "显示标题(&T)");
  39. formData.SOAOfficeCtrl.AppendMenuItem(5, "-");
  40. formData.SOAOfficeCtrl.AppendMenuItem(6, "全文手写批注(&D)");
  41. formData.SOAOfficeCtrl.AppendMenuItem(7, "插入印章(&I)");
  42. formData.SOAOfficeCtrl.AppendMenuItem(8, "接受所有修订(&A)", false);
  43. formData.SOAOfficeCtrl.AppendMenuItem(9, "-");
  44. formData.SOAOfficeCtrl.AppendMenuItem(10, "分层显示手写批注(&G)");
  45. formData.SOAOfficeCtrl.Caption="芜湖易通信息技术有限公司--在线文档编辑器";
  46. formData.SOAOfficeCtrl.SaveDocURL = "SaveDoc.asp";
  47. formData.SOAOfficeCtrl.WebOpen(sfname,2,"2");
  48. return true; 
  49. catch (e) 
  50. var ErrorMsg = '未定义的意外错误。';
  51. alert(e.description);
  52. WEBWORD_OBJECT.innerHTML="<div align=center><b><font color=red>文档加载失败,错误信息:"+e.description+"</font></b></div>"; 
  53. return false; 
  54. function soaClose() 
  55. try {
  56. if (bDocOpen)
  57. formData.SOAOfficeCtrl.Close();
  58. return true; 
  59. catch (e) 
  60. alert("关闭文档失败!n错误信息:"+e.message); 
  61. return false; 
  62. }  
  63. //文档另存为Html,并发布到web服务器
  64. function SaveAsHtml()
  65. {
  66. try {
  67. alert("绿色版没有提供另存HTML的功能。");
  68. //formData.SOAOfficeCtrl.WebSaveAsHtml();
  69. catch (e) 
  70. {
  71. alert("保存为Html失败!n错误信息:" + e.message); 
  72. }
  73. }
  74.     </script>
  75.         <script type="text/javascript"  language="JavaScript" event="OnDocumentOpened(str, obj)" for="SOAOfficeCtrl">
  76.     bDocOpen = true;
  77.         </script>
  78. <script type="text/javascript"  language="JavaScript" event="OnDocumentClosed()" for="SOAOfficeCtrl">
  79. bDocOpen = false;
  80. </script>
  81. <script type="text/javascript"  language="JavaScript" event="OnUserMenuClick(index, caption)" for="SOAOfficeCtrl">
  82. if(index == 1) soaShowTrack(true);
  83. if(index == 2) soaShowTrack(false);
  84. if(index == 4) alert("该菜单的标题是:"+caption);
  85. if(index == 6) soaStartHandDraw();
  86. if(index == 7) soaInsertSeal();
  87. if(index == 8) soaAcceptAllRevisions();
  88. if(index == 10) soaShowHandDrawDispBar();
  89. </script>
  90.     <form name="formData" method="post" action="UploadDoc.asp?Type=word&ID=1" id="formData" runat="server">
  91.             
  92. <table cellSpacing=0 cellPadding=0 width="100%" border=0 >
  93. <tr>
  94. <td height="4"></td>
  95. </tr>
  96. </table>
  97. <table height="10" cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="">
  98. <TBODY>
  99. <TR>
  100. <td  width="10" height ="10"  align="left" >  <IMG src="images/img_blanklogo_1.gif" width="10" height="10"></td>
  101. <td   width="98%" background="images/img_blanklogo_2.gif" align="center"></td>
  102. <td   width="10"   align="right"><IMG src="images/img_blanklogo_3.gif" width="10" height="10"></td>
  103.   </TR>
  104. </TBODY>
  105.    </table>
  106. <table height="21" cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="#EEEEEE">
  107. <TBODY>
  108. <TR>
  109. <td width="6" bgcolor="#FFFFFF">&nbsp;</td>
  110. <td  style="font-size:9pt" width=140 nowrap>&nbsp;&nbsp;SOAOffice2007 控件 </td>
  111. <td><SPAN class="ltsep">|</SPAN></td>
  112. <td  style="font-size:9pt" width=177 nowrap>&nbsp;&nbsp;当前操作模式:<font color="#FF0000">修改无痕迹</font></td>
  113. <td><SPAN class="ltsep">|</SPAN></td>
  114. <td style="font-size:9pt" width="100%">&nbsp;&nbsp;文档主题:<input name="inputSubject" class=thinInput type="text" value="word"><font color="#FF0000">&nbsp;&nbsp;双击控件标题栏最大化运行</font></td>
  115. <td width="5" bgcolor="#FFFFFF">&nbsp;</td>
  116. </TR>
  117. </TBODY>
  118. </table>
  119. <table cellSpacing="0" cellPadding="0" width="100%" border="0">
  120. <TBODY>
  121. <TR vAlign="top">
  122. <td style="OVERFLOW-X: hidden" width="10" height="100%" bgcolor="#FFFFFF">&nbsp; </td>
  123. <td width="100%">
  124.                                 <fieldset >
  125.                                 <table cellspacing="0" cellpadding="0" width="100%" border="0">
  126.                                     <tr>
  127.                                     <td>
  128.                                     <tbody>
  129.                                         <tr valign="top" align="left">
  130.                                             <td height="655"><span id="WEBWORD_OBJECT">
  131.                                                 <%--<object id="SOAOfficeCtrl" codebase="http://localhost:3190/Web/Workflow/SOAOffice.ocx#version=3,1,1,0" height="100%"
  132.                             width="100%" classid="clsid:BBD0982A-63C3-4105-B7AF-5FF3E2649082" data="">--%>
  133.                             <object id="SOAOfficeCtrl" codebase="<%=BaseUrl%>SOAOffice.ocx#version=3,1,1,0" height="100%"
  134.                             width="100%" classid="clsid:BBD0982A-63C3-4105-B7AF-5FF3E2649082" data="">
  135.                             <%--<param name="Server" value="<%=ServerIP%>">--%>
  136.                             <param name="ServerPort" value="4357">
  137.                             <param name="BorderStyle" value="0">
  138.                             <param name="TitleBarColor" value="16777215">
  139.                             <param name="TitlebarTextColor" value="0">
  140.                             <%--<param name="MenubarColor" value="<%=menubarColor%>">
  141.                             <param name="MenubarStyle" value="<%=Int((6 * Rnd()) + 1)%>">--%>
  142.                             <span style="color:red">未能载入SOAOfficeCtrl文档控件。请在安装控件的提示对话框里确认安装,才能使用本控件的功能。</SPAN>
  143.                             </object>
  144.                             </span>
  145.                             </td>
  146.                                         </tr>
  147.                                     </tbody>
  148.                             <%-- http://localhost:3190/Web/Workflow/DocTemplate项目预算表.doc--%>
  149.                                 </td>
  150.                             </tr>
  151.                             </table>
  152.                             </fieldset>
  153. </td>
  154. <td style=" overflow:hidden;" width="10" height="100%" bgcolor="#FFFFFF">&nbsp;</td>
  155. </TR>
  156. </TBODY>
  157. </table>
  158. </form>
  159. </body>
  160. </html>