How to open word document with /m “Macro argument” from java/or command-line without to specifi winword.exe path

人盡茶涼 提交于 2019-12-06 02:21:10

I see two options for you:

  1. Read the path to winword.exe from the Registry. It is stored under

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Word\InstallRoot
    

    where 12.0 needs to be the correct Office version (Office 2007 = 12, Office 2003 = 11 etc).

  2. Instead of using the /m switch you could also use an auto macro. How this is done is described here:

    http://support.microsoft.com/kb/211659

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!