Start Microsoft Word using Jscript

This is pretty old trick to use Active X Control to get an instance of application.
// Start Microsoft Word using Jscript
var createDoc = function (msg) {
    var MsWord = new ActiveXObject("Word.Application");
    MsWord.Documents.Add();
    MsWord.Selection.TypeParagraph();
    MsWord.Selection.TypeText("line 1 text1: " + msg);
    MsWord.Selection.TypeParagraph();
    MsWord.Selection.TypeParagraph();
    MsWord.Selection.TypeText("line2 text2: this is line two");
    MsWord.Visible = true;
};