...
var wsh = new ActiveXObject('WScript.Shell')
wsh.run(winword)
....

解决方案 »

  1.   

    to aotianlong:
    FSO 是什么?您能在详细点吗?to wjnjine:
    保存的代码呢?
      

  2.   

    给你断呆码参考一下吧:
    <script language="vbscript">On Error Resume NextDim wAppSet wApp = CreateObject("Word.Application")
    If Err.number > 0 Then
    Alert "没法保存为Word文件,请正确安装Word97"
    else
    wApp.Documents.add

             wApp.Selection.ParagraphFormat.Alignment = 1 
             wApp.Selection.TypeParagraph
    wApp.Selection.Font.Bold = True
    wApp.Selection.TypeText " 一周工作计划安排"
    wApp.Selection.TypeParagraph   

    wApp.Selection.ParagraphFormat.LeftIndent = wApp.CentimetersToPoints(0)
    wApp.Selection.ParagraphFormat.FirstLineIndent = wApp.CentimetersToPoints(0.72/2*2)

    wApp.Selection.TypeParagraph
    wApp.Selection.Font.Bold = false
    wApp.Selection.ParagraphFormat.Alignment = 0
    wApp.Selection.TypeText "星期 一:早上对erp进行修改,以适合门市部的销售模式。  下午:同上"
    wApp.Selection.TypeParagraph
        wApp.Selection.TypeText "星期 二:早上对erp进行修改,以适合门市部的销售模式。  下午:同上"
    wApp.Selection.TypeParagraph
        wApp.Selection.TypeText "星期 三:早上到门市部进行实地数据采集。              下午:同上"
    wApp.Selection.TypeParagraph
        wApp.Selection.TypeText "星期 四:针对门市部饶经理的要求,对erp的销售模块及库存管理模块重新进行修改。"
    wApp.Selection.TypeParagraph
        wApp.Selection.TypeText "星期 五:写出分析报告,及数据表汇总表。"
    wApp.Selection.TypeParagraph
        wApp.Selection.TypeText "星期 六:写代码"
    wApp.Selection.TypeParagraph
    wApp.Selection.ParagraphFormat.Alignment = 2 
    wApp.Selection.TypeParagraph   
    wApp.Selection.Font.Bold = false                  
    wApp.Selection.TypeText "软件部:XXX"
    wApp.Selection.TypeParagraph    wApp.Selection.TypeText "2003.7.20"
    wApp.Selection.TypeParagraph    wApp.ActiveDocument.SaveAs("c:\test.doc")
    end if
    </script>
      

  3.   

    在客户端c盘根目录下创建并保存word文档test1.doc:
    <script>
    var wrd=new ActiveXObject("Word.Application")
    wrd.visible=true
    wrd.Documents.Add()
    wrd.Selection.TypeText("测试!") '写入内容
    wrd.Application.Activate()
    wrd.ActiveDocument.SaveAs("c:\\test1.doc") '保存文档
    wrd=null
    </script>
      

  4.   

    非常感谢 manyou 得热心帮助,但发现您的代码运行后在关闭 ie 后 WinWord进程 没有退出! 这是为什么呢?
      

  5.   

    请问为什么被打开的word文档没有显示在IE中,而是以对立窗体打开的?
    我用 window.navigate("c:\thisWordFile.doc")
    提示脚本该对象 不支持该操作!! 
    怎么才能让打开的word 文档 嵌入在IE中????