I'm using the following code to open a Word document from javascript:
function openWord(file) {
try {
var objword = new ActiveXObject("Word.Application");
} catch (e) {
alert(e + 'Cannot open Word');
}
if (objword != null) {
objword.Visible = true;
objword.Documents.Open(file);
}
}
This works fine the only problem is that the Word application does not come to the front when opened, instead it opens just behind the browser. Is there a way to force Word to open on top of any other window? or to bring it to front when its open?
Not exactly perfect but this worked for me:
it still opens Word in the background, but then forces a minimize - maximize and brings it to front.