如何用.net在IE中嵌入word/excel界面,就像在IE中操作word/excel那样。

解决方案 »

  1.   

    用owc
    <OBJECT id=Spreadsheet1 codeBase=file:\Bobsoftwareoffice2000msowc.cab height=250 width="100%" classid=clsid:0002E510-0000-0000-C000-000000000046><PARAM NAME="HTMLURL" VALUE=""><PARAM NAME="HTMLData" VALUE="<html xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;&#13;&#10;xmlns=&quot;http://www.w3.org/TR/REC-html40&quot;>&#13;&#10;&#13;&#10;<head>&#13;&#10;<style type=&quot;text/css&quot;>&#13;&#10;<!--tr&#13;&#10;&#9;{mso-height-source:auto;}&#13;&#10;td&#13;&#10;&#9;{white-space:nowrap;}&#13;&#10;.wcC8908C&#13;&#10;&#9;{white-space:nowrap;&#13;&#10;&#9;font-family:宋体;&#13;&#10;&#9;mso-number-format:General;&#13;&#10;&#9;font-size:auto;&#13;&#10;&#9;font-weight:auto;&#13;&#10;&#9;font-style:auto;&#13;&#10;&#9;text-decoration:auto;&#13;&#10;&#9;mso-background-source:auto;&#13;&#10;&#9;mso-pattern:auto;&#13;&#10;&#9;mso-color-source:auto;&#13;&#10;&#9;text-align:general;&#13;&#10;&#9;vertical-align:bottom;&#13;&#10;&#9;border-top:none;&#13;&#10;&#9;border-left:none;&#13;&#10;&#9;border-right:none;&#13;&#10;&#9;border-bottom:none;&#13;&#10;&#9;mso-protection:locked;}&#13;&#10;-->&#13;&#10;</style>&#13;&#10;</head>&#13;&#10;&#13;&#10;<body>&#13;&#10;<!--[if gte mso 9]><xml>&#13;&#10; <x:ExcelWorkbook>&#13;&#10;  <x:ExcelWorksheets>&#13;&#10;   <x:ExcelWorksheet>&#13;&#10;    <x:OWCVersion>9.0.0.6430</x:OWCVersion>&#13;&#10;    <x:Label Style='border-top:solid .5pt silver;border-left:solid .5pt silver;&#13;&#10;     border-right:solid .5pt silver;border-bottom:solid .5pt silver'>&#13;&#10;     <x:Caption>Microsoft Office Spreadsheet</x:Caption>&#13;&#10;    </x:Label>&#13;&#10;    <x:Name>Sheet1</x:Name>&#13;&#10;    <x:WorksheetOptions>&#13;&#10;     <x:Selected/>&#13;&#10;     <x:Height>6615</x:Height>&#13;&#10;     <x:Width>13944</x:Width>&#13;&#10;     <x:TopRowVisible>0</x:TopRowVisible>&#13;&#10;     <x:LeftColumnVisible>0</x:LeftColumnVisible>&#13;&#10;     <x:ProtectContents>False</x:ProtectContents>&#13;&#10;     <x:DefaultRowHeight>210</x:DefaultRowHeight>&#13;&#10;     <x:StandardWidth>2389</x:StandardWidth>&#13;&#10;    </x:WorksheetOptions>&#13;&#10;   </x:ExcelWorksheet>&#13;&#10;  </x:ExcelWorksheets>&#13;&#10;  <x:MaxHeight>80%</x:MaxHeight>&#13;&#10;  <x:MaxWidth>80%</x:MaxWidth>&#13;&#10; </x:ExcelWorkbook>&#13;&#10;</xml><![endif]-->&#13;&#10;&#13;&#10;<table class=wcC8908C x:str>&#13;&#10; <col width=&quot;56&quot;>&#13;&#10; <tr height=&quot;14&quot;>&#13;&#10;  <td></td>&#13;&#10; </tr>&#13;&#10;</table>&#13;&#10;&#13;&#10;</body>&#13;&#10;&#13;&#10;</html>&#13;&#10;"><PARAM NAME="DataType" VALUE="HTMLDATA"><PARAM NAME="AutoFit" VALUE="0"><PARAM NAME="DisplayColHeaders" VALUE="-1"><PARAM NAME="DisplayGridlines" VALUE="-1"><PARAM NAME="DisplayHorizontalScrollBar" VALUE="-1"><PARAM NAME="DisplayRowHeaders" VALUE="-1"><PARAM NAME="DisplayTitleBar" VALUE="-1"><PARAM NAME="DisplayToolbar" VALUE="-1"><PARAM NAME="DisplayVerticalScrollBar" VALUE="-1"><PARAM NAME="EnableAutoCalculate" VALUE="-1"><PARAM NAME="EnableEvents" VALUE="-1"><PARAM NAME="MoveAfterReturn" VALUE="-1"><PARAM NAME="MoveAfterReturnDirection" VALUE="0"><PARAM NAME="RightToLeft" VALUE="0"><PARAM NAME="ViewableRange" VALUE="1:65536"></OBJECT>
      

  2.   

    fmjwn(zYb)您好,您的方法能够实界面显示,但无法对文档进行保存,也无法对word进行操作,您还有没有新招啊?
      

  3.   

    Response.ContenType = "Application/ X-msexcel"; 
    string FilePath = MapPath("文件名称.xls"); Response.WriteFile(FilePath); Response.End();
      

  4.   

    http://search.csdn.net/Expert/topic/2008/2008113.xml?temp=.5568506
    http://search.csdn.net/Expert/topic/1756/1756449.xml?temp=9.685916E-02有人说用Spreadsheet 组件,可以参考下面http://www.microsoft.com/china/msdn/archives/library/techart/Msowcbasics.asp