返回首页
当前位置: 主页 > 精通Office > Word教程 >

如何实现IE直接调用Word进程程序代码

时间:2011-05-26 22:59来源:知行网www.zhixing123.cn 编辑:麦田守望者

<script>
var wrd=new ActiveXObject("Word.Application")
wrd.visible=true
alert("您的"+wrd.Application.Caption+"安装路径为:\n"+wrd.Application.Path+"\n版本号是:"+wrd.Application.version+"\n注册使用者是:"+wrd.Application.UserName)
wrd.Documents.Open("c:/a.doc")
wrd.Selection.TypeText("This is some text.")
wrd.Application.Activate()
wrd.ActiveDocument.PageSetup.LeftMargin = 20
wrd.ActiveDocument.PageSetup.RightMargin = 20

wrd.ActiveDocument.SaveAs("c:/a.doc")
wrd=null
</script>

------分隔线----------------------------
标签(Tag):Word Word2007 Word2003 Word2010 Word教程
------分隔线----------------------------
推荐内容
猜你感兴趣