类型:转载 责任编辑:asp 日期:2007/03/01
当打开连接的word文档,出现下面错误信息:
你不能不能关闭microsoft word文档,当前有一个对话框处于活动状态.
请切换到microsoft word文档,关闭对话框
现在只能给100,问题解再开辟散分的栏目.谢谢!
推荐阅读
你用open的方法打开一个word文档试一下吧,我以前同样的问题1
呵呵,前几天我的机子也是那样了,你先在任务管理器里关闭word的进程,然后随便到一个文件夹下打开菜单上的工具选取文件夹选项,选择文件类型标签,在已注册的文件类型中找到doc类型,然后选择高级按钮在弹出的对话框里选择open删除它,然后新建一个open,选择用word打开
如果还是不行就得修改注册表了
不允许在ie中同时打开多个的word的进程。
我在网上下的看看能不能帮上忙。
注意:函数中的“data“是网页中要导出的table的 id
<input type="hidden" name="out_word" onclick="vbscript:builddoc" value="导出到word" class="notprint">
<input type="hidden" name="out_excel" onclick="automateexcel();" value="导出到excel" class="notprint">
</script>
导出到word代码
<script language="vbscript">
sub builddoc
set table = document.all.data
row = table.rows.length
column = table.rows(1).cells.length
set objworddoc = createobject("word.document")
objworddoc.application.documents.add thetemplate, false
objworddoc.application.visible=true
dim thearray(20,10000)
for i=0 to row-1
for j=0 to column-1
thearray(j+1,i+1) = table.rows(i).cells(j).innertext
next
next
objworddoc.application.activedocument.paragraphs.add.range.insertbefore("综合查询结果集") //显示表格标题
objworddoc.application.activedocument.paragraphs.add.range.insertbefore("")
set rngpara = objworddoc.application.activedocument.paragraphs(1).range
with rngpara
.bold = true //将标题设为粗体
.paragraphformat.alignment = 1 //将标题居中
.font.name = "隶书" //设定标题字体
.font.size = 18 //设定标题字体大小
end with
set rngcurrent = objworddoc.application.activedocument.paragraphs(3).range
set tabcurrent = objworddoc.application.activedocument.tables.add(rngcurrent,row,column)
for i = 1 to column
objworddoc.application.activedocument.tables(1).rows(1).cells(i).range.insertafter thearray(i,1)
objworddoc.application.activedocument.tables(1).rows(1).cells(i).range.paragraphformat.alignment=1
next
for i =1 to column
for j = 2 to row
objworddoc.application.activedocument.tables(1).rows(j).cells(i).range.insertafter thearray(i,j)
objworddoc.application.activedocument.tables(1).rows(j).cells(i).range.paragraphformat.alignment=1
next
next
end sub
</script>
重启动。
卸载ie中的网络实名功能,有装金山毒霸的也要卸载,word就肯定可以打开了。
通常来说在ie中打开word不能直接打开,必须使用流写出来,你用下面代码
<%
filepath是取得这个文件的路经和文件名,如 /a.doc
response.contenttype="application/msword"
const adtypebinary = 1
dim strfilepath
filepath=request("filepath")
strfilepath = server.mappath(filepath)
set objstream = server.createobject("adodb.stream")
objstream.open
objstream.type = adtypebinary
objstream.loadfromfile strfilepath
response.binarywrite objstream.read
objstream.close
set objstream = nothing
%>
上面这段代码放在打开word文档的新窗口中,记住前面不要再加任何html标签,如<html><body>等,这些都不需要
.