I am converting a VBS to JS
. Called by a button click, it opens Word, invokes the spelling checker, passes the text to Word, and returns the corrected text to the text field being checked. It worked just fine in VBS, but I've run into a problem with this JS
oDoc = oWord.Documents.Add( , , 1, true);
The first two empty parms causes a "undefined function" error before it even tries to run the script. It at least tries to run the script if I change those parameters to null:
oDoc = oWord.Documents.Add(null, null, 1, true);
But that throws a "Type mismatch" error.
The method clearly didn't care about those parms when called by VBS. Isn't there some way to tell it to ignore them when called by JS
? I can't find any useful examples using JS
, leading another developer to believe JS
simply can't do it.