分享

web公文留痕(word插件实现方式)

 IT民工收藏 2013-06-19

<script language="javascript">
   function PostData(PaperGuid,fileName,action)
   {
    var xmldoc=new ActiveXObject("Microsoft.XMLDOM");
    xmldoc.loadXML("<root><paperguid>"+PaperGuid+"</paperguid><filename>"+fileName+"</filename><action>"+action+"</action></root>");
       
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.Open("POST", "SendPaperTemplateList.aspx?Act=1", false);
    xmlhttp.Send(xmldoc); 
    alert("保存成功!");
   }
   
   function GetLastDoc(PaperGuid)
   {
    var xmldoc=new ActiveXObject("Microsoft.XMLDOM");
    xmldoc.loadXML("<root><paperguid>"+PaperGuid+"</paperguid></root>");
       
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.Open("POST", "SaveRepaire.aspx?Act=GetLastDoc", false);
    xmlhttp.Send(xmldoc); 
    var destxml=new ActiveXObject("Microsoft.XMLDOM"); 
    destxml=xmlhttp.responseXML
    //alert(destxml.xml);
    SendPaperDocument.oframe.caption="发文正文"+":"+destxml.documentElement.childNodes[1].text+" "    
    SendPaperDocument.txtFileName.value=destxml.documentElement.childNodes[2].text
    return destxml.documentElement.childNodes[0].text;    
   }
   
   function GetFileName()
   {
    var xmldoc=new ActiveXObject("Microsoft.XMLDOM");
    xmldoc.loadXML("<root>1</root>");
       
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.Open("POST", "SaveRepaire.aspx?Act=GetFileName", false);
    xmlhttp.Send(xmldoc); 
    var destxml=new ActiveXObject("Microsoft.XMLDOM"); 
    destxml=xmlhttp.responseXML       
    return destxml.text;  
   }
   
   function HideButton()
   {
    if(SendPaperDocument.txtAction.value!="Entry" && SendPaperDocument.txtAction.value!="Record")
    {
     SendPaperDocument.cmdOpen.style.display="none";
     SendPaperDocument.cmdOpenTemplate.style.display="none";
    }
    else
    {
     SendPaperDocument.oframe.ActiveDocument.TrackRevisions = false
    }
    
    if(SendPaperDocument.txtAction.value=="POH")
    {
     SendPaperDocument.cmdOpen.style.display="none";
     SendPaperDocument.cmdOpenTemplate.style.display="none";
     SendPaperDocument.cmdAccept.style.display="none";
     SendPaperDocument.cmdAddPicture.style.display="none";
     SendPaperDocument.cmdSave.style.display="none"; 
    }
    
    if(SendPaperDocument.txtAction.value=="Record")
    {
     SendPaperDocument.cmdProtect.style.display=""; 
      
   }
  </script>
 </HEAD>
 <BODY leftMargin="0" topMargin="0" onload="PageLoad('<%=Session["WAF_UserCName"]%>')">
  <form id="SendPaperDocument" method="post" runat="server">
   <FONT face="宋体">
    <TABLE id="Table1" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
     <TR>
      <TD>
       <!--OBJECT language="vbscript" id="oframe" height="99.96%" width="100%" classid="clsid:00460182-9E5E-11d5-B7C8-B8269041DD57" name="oframe" VIEWASTEXT-->
       <OBJECT language="vbscript" id="oframe" height="99.96%" width="100%" CLASSID="CLSID:00460182-9E5E-11d5-B7C8-B8269041DD57" CODEBASE="dsoframerctl.CAB#version=1,0,0,0" name="oframe" VIEWASTEXT>
        <PARAM NAME="_ExtentX" VALUE="15954">
        <PARAM NAME="_ExtentY" VALUE="13573">
        <PARAM NAME="BorderColor" VALUE="-2147483632">
        <PARAM NAME="BackColor" VALUE="-2147483643">
        <PARAM NAME="ForeColor" VALUE="-2147483640">
        <PARAM NAME="TitlebarColor" VALUE="52479">
        <PARAM NAME="TitlebarTextColor" VALUE="0">
        <PARAM NAME="BorderStyle" VALUE="1">
        <PARAM NAME="Titlebar" VALUE="0">
        <PARAM NAME="Toolbars" VALUE="1">
       </OBJECT>
      </TD>
     </TR>
     <TR height="30">
      <TD>
       <INPUT class="button" style="display:none" onclick="NewDoc" type="button" value="新建文件" id="cmdNew"> <INPUT class="button" onclick="OpenDoc" type="button" value="打开文件" id="cmdOpen">
       <INPUT class="button" onclick="OpenWebDoc" type="button" value="打开模板" id="cmdOpenTemplate"> <INPUT class="button" onclick="UploadDoc('<%Response.Write(System.Configuration.ConfigurationSettings.AppSettings["SendPaperDocPath"].ToString());%>')" type="button" value="保存文件" id="cmdSave"> <INPUT class="button" onclick="ViewHistory" type="button" value="查看历史" id="cmdViewHistory">
        <INPUT class="button" onclick="AcceptRevisions" type="button" value="清稿" id="cmdAccept">
         <INPUT class="button" onclick="AddPicture('<%Response.Write(System.Configuration.ConfigurationSettings.AppSettings["SendPaperDocOpenPath"].ToString());%>')" type="button" value="用印" id="cmdAddPicture">
          <INPUT class="button" onclick="PrintDoc" type="button" value="打印" id="cmdPrint">
          <INPUT class="button" style="display:none" onclick="ProtectDoc('<%Response.Write(System.Configuration.ConfigurationSettings.AppSettings["SendPaperDocPath"].ToString());%>')" type="button" value="保护文件" id="cmdProtect">
       <INPUT class="button" style="display:none" onclick="CloseDoc('')" type="button" value="关闭文件"> <INPUT id="txtPaperGuid" style="DISPLAY: none" type="text" runat="server" NAME="txtPaperGuid">
       <INPUT id="txtAction" style="DISPLAY: none" type="text" runat="server" NAME="txtAction">
       <INPUT id="txtFileName" style="DISPLAY: none" type="text" NAME="txtFileName"></TD>
     </TR>
    </TABLE>
   </FONT>
  </form>
 </BODY>
</HTML>

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多