Skip to content Skip to sidebar Skip to footer

Bring Spell Check Window To Foreground With Javascript/jscript In Windows 7

I have some JScript code (converted from some old VBScript) that starts like this: var Word = new ActiveXObject('Word.Basic'); Word.FileNew(); // opens new Word document Word.Inse

Solution 1:

You might be able to jigger the window state. When the window is maximized after having been minimized, Windows will stack that in front (zIndex to top).

Something like:

varWIN_MAX = 2;
 varWIN_MIN = 1;

 varWord = newActiveXObject("Word.Application");
 Word.Visible = true;
 // minimize the appWord.WindowState = WIN_MIN ;
 // in 500ms, maximizesetTimeout(function () {
     Word.WindowState = WIN_MAX;
 }, 500);

The setTimeout call seeks to work around a timing issue; Windows will sometimes "get confused" when a programmatic minimize/maximize happens in immediate succession. You might have to extend that delay a little, test it repeatedly and see what kind of results you get.

Post a Comment for "Bring Spell Check Window To Foreground With Javascript/jscript In Windows 7"