日期:2014-05-19  浏览次数:20849 次

word编程问题
我想在用户打开word的同时执行一段逻辑,比如提示 "hello   world "

请问有何实现方式??

------解决方案--------------------
用vbs文件来实现:
Set Shell=Wscript.Createobject( "Wscript.shell ")
Shell.run "111.DOC " '在此输入你的111.DOC位置。
Wscript.Sleep 5000 '等待5秒
Shell.Sendkeys "123 "
Shell.Sendkeys "{Enter} "
msgbox "hello word "
然后用程序直接打开这个vbs文件就可以了
------解决方案--------------------
楼主是指在word文档 中 执行一些逻辑?

------解决方案--------------------
在该WORD文件对应的vba脚本的document_load之类的方法里加入一段逻辑
------解决方案--------------------

------解决方案--------------------
哈哈,可以用office套件自己开发打开word的工具
------解决方案--------------------
up
------解决方案--------------------
You can insert a macro in C# if the you changed the security option in word.
http://support.microsoft.com/kb/q194906/