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

.net编程

开发平台:

C#

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