I have a Word template with a macro defined in the ThisDocument section:
Sub Go(pID As Integer, pPassword As String)
I am trying to execute this macro from JScript as follows:
application.Run("Go", 1, "secr开发者_开发问答et");
But this fails - what am I doing wrong?
Ok, found one answer:
- remove the parameters
use document variables instead:
document.Variables.Add("id", 1); document.Variables.Add("password", "secret"); application.Run("Go");
精彩评论