Pages

9/26/2014

Test Word Open & Save Repeatedly

From: OpLocks.net

var i;
var myApp = new ActiveXObject("Word.Application");
myApp.Visible = true;
for (i = 0; i < 1234; i++)
 {
  myApp.Documents.Open("C:\\TEMP\\testword.doc");
  //myApp.ActiveDocument.SaveAs("C:\\TEST\\testword.doc");
  myApp.Documents.Close();
 }
myApp.Application.Quit();
paste in editor and save as "test.js" for example. to run: cscript test.js

No comments: