[求助]新人求助,在线等,哪位大侠路过方便指点下下!
<%@ page contentType="application/vnd.ms-word;charset=GBK" language="java"%> <%@ include file="/jsp/common/taglibs.jsp"%>
<html>
<head>
<script language="javascript">
function OpenWord(){
var wordApp = null;
try{
wordApp = new ActiveXObject('Word.Application');
}catch(e)
{
alert(e+', 原因分析: 浏览器安全级别较高导致不能创建Word对象或者客户端没有安装Word软件');
return;
}
var oDC = wordApp.Documents.Add('',0,1);
wordApp.Application.Visible = false;
var oRange =oDC.Range(0,1);
var sel = document.body.createTextRange();
sel.select();
sel.execCommand('Copy');
sel.moveEnd('character')
wordApp.Application.Visible = false;
oRange.Paste();
wordApp.visible = false;
wordApp.Application.ActiveDocument.SaveAs(filename,false);
<%
response.setHeader("Content-disposition","attachment; filename="+ new String("1.doc".getBytes(), "ISO8859_1"));
%>
wordApp.ActiveDocument.close();
location.reload()
}
</script>
</head>
<body></body>
</html>
当我想跳转到这个jsp页面的时候,他会自动帮我把这个页面下载或者打开.doc文档,但有个问题,这个页面body中所有的图片无法显示,在下载或者打开的word文档中是个叉,我想请教下,怎么处理?新人首次发帖,忘诸位大大指点一二