Thanks,
Lando
A good site for DHTML is
http://www.w3schools.com/dhtml/default.asp
Check out the overflow:scroll style and the window.scrollto
option.
*If* this is WSH-hosted, then using IEApp from the WSH
host, the easiest way to accomplish this is to use a textarea
box that you can write to with sendkeys (it automatically scrolls
continuously). (AutoItX is more reliable than sendkeys, if you
have it installed.) I've previously posted a NoticeDemo2.vbs
script that does that. It's a fairly good size attachment. If you
want a copy, post back and I'll email it to you. I don't know if
sendkeys is available on an ASP or HTML (or if you'd want to
chance using it on those hosts). You can just change the value
in the textarea box. That does not get you the automatic scroll,
but you can add the new data to the top, instead of the bottom.
Joe Earnest
"Lando" <la...@noemails.com> wrote in message
news:OlrDZ#p0CHA.1656@TK2MSFTNGP09...
Hi
I use this Sub in my logon script to always scroll at bottom:
Sub MsgMSIE(sMsg)
On Error Resume Next
oTheEnd.insertAdjacentHtml "beforeBegin", sMsg & "<BR>"
oTheEnd.scrollIntoView
End Sub
And when setting up the IE object:
With oIE
(snip)
With .document
(snip)
.Open
.Write "<span id='theEnd'></span>"
.Close
Set oTheEnd = .all.theEnd
.Title = sTitle
Full example:
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
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
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter
Very nice.
Regards,
Joe Earnest
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3E4A982A...@hydro.com...
> Hi
>
> I use this Sub in my logon script to always scroll at bottom:
> (snip)
> And when setting up the IE object:
> (snip)
> Full example:
> (snip)
> "Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
> news:3E4A982A...@hydro.com...
> > Hi
> >
> > I use this Sub in my logon script to always scroll at bottom:
> > (snip)
>
> Hi Torgeir,
>
> Very nice.
Thanks :-)
If my memory doesn't fail me, I picked up the oTheEnd.insertAdjacentHtml
"beforeBegin" trick from some Michael Harris code...