Is there a way to have a msgbox or wscript.echo include a scroll bar for
output that is larger than window?
Thanks
Jeff
"FrodoBaggins" <jeffunderscorebev...@delete.this> wrote in
message news:OXhZaeE...@TK2MSFTNGP10.phx.gbl...
> Is there a way to have a msgbox or wscript.echo include a scroll bar for
> output that is larger than window?
Hi
You can e.g. use the InternetExplorer.Application object for this. Put the
attached script below in a vbs file and run it for a demo.
More examples here as well:
http://groups.google.com/groups?th=edcd583fdebb074e
http://groups.google.com/groups?selm=3E4A982A.7704AE12%40hydro.com
http://groups.google.com/groups?selm=3EA302E5.5BAE90EB%40hydro.com
'--------------------8<----------------------
Dim oTheEnd ' important that this is dimmed as a global variable!!!
Set oIE = CreateObject("InternetExplorer.Application")
SetupMSIE
MsgMSIE "<BR>Processing Logon Script..."
MsgMSIE "<HR><BR>"
' rest of logon script
For i = 1 To 50
MsgMSIE "Test line " & i
Next
' If you want to close the window, enable the lines below
' Just in case the dialog is closed (with e.g. Alt-F4),
' supress error from oIE
'On Error Resume Next
'oIE.Quit
'On Error Goto 0
Sub SetupMSIE
Dim sTitle, SWidth,SHeight, SWidthW, SHeightW
sTitle = "AD Logon"
With oIE
' Not an option with IE 6 SP1
'.FullScreen = True
.AddressBar = False
.ToolBar = False
.StatusBar = False
.Resizable = False
.Navigate("about:blank")
Do Until .readyState = 4: wscript.sleep 100: Loop
With .document
With .ParentWindow
SWidth = .Screen.AvailWidth
SHeight = .Screen.AvailHeight
SWidthW = .Screen.AvailWidth / 2
SHeightW = .Screen.AvailHeight / 1.5
.resizeto SWidthW, SHeightW
.moveto (SWidth - SWidthW)/2, (SHeight - SHeightW)/2
End With
.Open
.Write "<span id='theEnd'></span>"
.Close
Set oTheEnd = .all.theEnd
.Title = sTitle
With .ParentWindow.document.body
.style.backgroundcolor = "LightBlue"
.style.Font = "10pt 'Arial'"
'.style.borderStyle = "outset"
'.style.borderWidth = "4px"
' .scroll="no"
End With
oIE.Visible = True
End With ' document
End With ' oIE
End Sub
Sub MsgMSIE(sMsg)
On Error Resume Next
oTheEnd.insertAdjacentHtml "beforeBegin", sMsg & "<BR>"
oTheEnd.scrollIntoView
End Sub
'--------------------8<----------------------
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter