Question : Set zoom level on a new internet explorer window

Hi,
I have created a web page using javascript that open several webpages. Each webpage has it's own location and size. One of the webpages should be opened with zoom=150% to make the content bigger.
How can I achive this?

I have a function that use:
window.open(url,title,width=xx, top=xx, height=xx);

Answer : Set zoom level on a new internet explorer window

Please find the complete code below
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
<html>
<head>
<title>olecmdid</title>
<script>
var OLDCMDID = {
  OLECMDID_OPEN                             : 1,
  OLECMDID_NEW                              : 2,
  OLECMDID_SAVE                             : 3,
  OLECMDID_SAVEAS                           : 4,
  OLECMDID_SAVECOPYAS                       : 5,
  OLECMDID_PRINT                            : 6,
  OLECMDID_PRINTPREVIEW                     : 7,
  OLECMDID_PAGESETUP                        : 8,
  OLECMDID_SPELL                            : 9,
  OLECMDID_PROPERTIES                       : 10,
  OLECMDID_CUT                              : 11,
  OLECMDID_COPY                             : 12,
  OLECMDID_PASTE                            : 13,
  OLECMDID_PASTESPECIAL                     : 14,
  OLECMDID_UNDO                             : 15,
  OLECMDID_REDO                             : 16,
  OLECMDID_SELECTALL                        : 17,
  OLECMDID_CLEARSELECTION                   : 18,
  OLECMDID_ZOOM                             : 19,
  OLECMDID_GETZOOMRANGE                     : 20,
  OLECMDID_UPDATECOMMANDS                   : 21,
  OLECMDID_REFRESH                          : 22,
  OLECMDID_STOP                             : 23,
  OLECMDID_HIDETOOLBARS                     : 24,
  OLECMDID_SETPROGRESSMAX                   : 25,
  OLECMDID_SETPROGRESSPOS                   : 26,
  OLECMDID_SETPROGRESSTEXT                  : 27,
  OLECMDID_SETTITLE                         : 28,
  OLECMDID_SETDOWNLOADSTATE                 : 29,
  OLECMDID_STOPDOWNLOAD                     : 30,
  OLECMDID_FIND                             : 32,
  OLECMDID_DELETE                           : 33,
  OLECMDID_PRINT2                           : 49,
  OLECMDID_PRINTPREVIEW2                    : 50,
  OLECMDID_PAGEACTIONBLOCKED                : 55,
  OLECMDID_PAGEACTIONUIQUERY                : 56,
  OLECMDID_FOCUSVIEWCONTROLS                : 57,
  OLECMDID_FOCUSVIEWCONTROLSQUERY           : 58,
  OLECMDID_SHOWPAGEACTIONMENU               : 59,
  OLECMDID_ADDTRAVELENTRY                   : 60,
  OLECMDID_UPDATETRAVELENTRY                : 61,
  OLECMDID_UPDATEBACKFORWARDSTATE           : 62,
  OLECMDID_OPTICAL_ZOOM                     : 63,
  OLECMDID_OPTICAL_GETZOOMRANGE             : 64,
  OLECMDID_WINDOWSTATECHANGED               : 65,
  OLECMDID_ACTIVEXINSTALLSCOPE              : 66,
  OLECMDID_UPDATETRAVELENTRY_DATARECOVERY   : 67
}
function debug() {
  var result = "<table border=1>";
  var PROMPT = 1; // 1 PROMPT & 2 DONT PROMPT USER
  var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  for (i in OLDCMDID) {
    var status = WebBrowser1.QueryStatusWB(OLDCMDID[i]);
    result += "<tr><td>" + i + "</td><td>" + OLDCMDID[i] + "</td><td>" + status + "</td></tr>";
  }
  result += "</table>";
  WebBrowser1.outerHTML = "";
  document.getElementById("QueryStatusWB_Result").innerHTML = result;
}
function zoom(percent) {
  var PROMPT = 1; // 1 PROMPT & 2 DONT PROMPT USER
  var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  var status = WebBrowser1.QueryStatusWB(63);
  document.getElementById("QueryStatusWB_Result").innerHTML = status;
  WebBrowser1.ExecWB(63,PROMPT,percent,null);
  WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
<form name="form">
<input type="Button" value="Print Status Informations..." onclick="debug();">
<input type="Button" value="25%" onclick="zoom(25);">
<input type="Button" value="50%" onclick="zoom(50);">
<input type="Button" value="100%" onclick="zoom(100);">
<input type="Button" value="150%" onclick="zoom(150);">
<input type="Button" value="200%" onclick="zoom(200);">
</form>
<div id="QueryStatusWB_Result"></div>
</body>
</html>
Random Solutions  
 
programming4us programming4us