Associate
Hi,
Your CreateIE Sub routine is wrong. You cannot use Screen.Width in VBS. You should not use On Error Resume Next either. If you had not used this you would have realised there was an error.![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
To get the screen size as you intend to do you first fully need to load IE and navigate to a web page. Then you can the screen size through IE using .document.parentwindow.scree.height or width.
Here is your script fixed. How it worked before I have no idea.![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
TrUz
Your CreateIE Sub routine is wrong. You cannot use Screen.Width in VBS. You should not use On Error Resume Next either. If you had not used this you would have realised there was an error.
![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
To get the screen size as you intend to do you first fully need to load IE and navigate to a web page. Then you can the screen size through IE using .document.parentwindow.scree.height or width.
Here is your script fixed. How it worked before I have no idea.
![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
Code:
'Create IE Display Window
Sub CreateIE()
With CreateObject("InternetExplorer.Application")
'We need to navigate first.
.navigate wshLogonPath & "\logon.htm"
'Wait until the page has fully loaded.
Do while .Busy
Wscript.Sleep 700
Loop
'Ok page has loaded, set perameters.
.height = 520
.width = 380
.resizable=0
.menubar=0
.toolbar=0
.statusBar=0
.visible=1
'Now page has loaded and peramenters are set we can now move the window using .document.parentwindow.screen to get screen size etc...
.Top = (.document.parentWindow.screen.height / 2) - 260
.Left = (.document.parentWindow.screen.width / 2) - 190
End With
End Sub