Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Word 模板,其中包含在 ThisDocument 部分中定义的宏:
Sub Go(pID As Integer, pPassword As String)
我正在尝试从 JScript 执行此宏,如下所示:
application.Run("Go", 1, "secret");
但这失败了——我做错了什么?
好的,找到一个答案:
改用文档变量:
document.Variables.Add("id", 1); document.Variables.Add("password", "secret"); application.Run("Go");