up,我也想知道,最好是不要用第三方组件,并且可以对所有office版本的文档适用。
解决方案 »
- 编码问题
- 调用存储过程返回DataSet
- winfrom mainMenu动态生成事件
- 网页上传后不出现是否允许脚本或控件的对话框了
- 如何从SQL server 2005中,读取图片,并输出在页面上,我在数据库中存储图片的字段的类型是varbinary?
- 几个问题
- 数据库添加记录不成功,原因出在何处??
- 弱弱的问下 url 重写~
- ################大家一定要帮帮忙啊##############
- 新手的问题?名字空间
- 数据库连接问题(初级)
- vs.net中的html控件组也属于html控件,他和直接添加标记生成的控件有什么不同。如<button id="button1" runat=server>和直接从工具箱的ht
if(dr["doctype"].ToString()=="application/msword")
{
Response.ContentType = "application/msword";
}
else
{
Response.ContentType = "application/vnd.ms-excel";
}
Response.AddHeader("Content-Disposition", dr["doctitle"].ToString());
Response.Flush();
Response.BinaryWrite((byte[])dr["doctext"]);
Response.End();
以上是我写的,可以打开
正确的方法是在上传word文档时把文档转化为Html页面。
正确的方法是在上传word文档时把文档转化为Html页面。补充一下:这是用ApplicationClass对象的,你可以自己找一下,
可惜我源码记得不太清楚了,以前编写时应该不到10行代码就可以转化,只有ApplicationClass这个线索,给不给分自己瞧吧。
object file="c:\111.doc";
object readOnly=true;
object isVisible=true;
object n=System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc=app.Documents.Open(ref file,ref n,ref readOnly,ref n,ref n,ref n,ref n,ref n,ref n,ref n,ref n,ref isVisible,ref n,ref n,ref n,ref n);
doc.Activate();这个也不行呀,打开以后,是个空白的页面,什么也没有,word的进程倒是打开了两
代码有什么错误吗
word的版本很多,如果客户装的版本低,不一定会显示正确的