为什么在asp代码中创建word对象会有问题

 我来答
就烦条0o
2017-06-11 · 知道合伙人软件行家
就烦条0o
知道合伙人软件行家
采纳数:33315 获赞数:46493
从事多年系统运维,喜欢编写各种小程序和脚本。

向TA提问 私信TA
展开全部
代码
<%
Response.Write "<script language=vbscript>"& chr(13)
Response.Write "function InsertWord()" & chr(13)
Response.Write "on error resume next"& chr(13)
Response.Write "dim wordApp" & chr(13)
Response.Write "Set wordApp = CreateObject(""Word.Application"")" & chr(13)
Response.Write "if Err.Number<>0 then" & chr(13)
Response.Write " MsgBox ""本机没有安装Word2000,也可能生成新文件时出错!"", 16, ""输出到Word""" & chr(13)
Response.Write " set wordApp=nothing" & chr(13)
Response.Write " exit function" & chr(13)
Response.Write "end if" & chr(13)
Response.Write "WordApp.Visible = True" & chr(13)
Response.Write "WordApp.windowstate=1" & chr(13)
Response.Write "WordApp.Documents.Add " & chr(13)
Response.Write "WordApp.activewindow.View.ShowParagraphs=False" & chr(13)
Response.Write "wordApp.Selection.TypeText ""拟稿时间""" & chr(13)
Response.Write "wordApp.Selection.TypeText "" """ & chr(13)
Response.Write "wordApp.Selection.TypeText """ & ConvDateTime(rs1("DpcDate")) & """" & chr(13)
Response.Write "wordApp.Selection.TypeText "" """ & chr(13)
Response.Write "wordApp.Selection.TypeText ""拟稿人""" & chr(13)
Response.Write "wordApp.Selection.TypeText "" """ & chr(13)
Response.Write "wordApp.Selection.TypeText """ & strUserName & """" & chr(13)
Response.Write "wordApp.Selection.TypeParagraph" & chr(13)
%>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式