开发者

vbscript how to force the IE scroll bars to lock to the bottom

Im using IE as a form to provide feedback of running processes. As the processes update they eventually go beyond the window size. What I want to have happen is that the IE window will lock to the bottom of the page instead of the to开发者_如何学JAVAp, so as data appears it scrolls down - almost like a 'tail' function

This is what I use to create the IE window that I pump data into

Sub ExplorerWindow(strStage)

        Set objExplorer = WScript.CreateObject("InternetExplorer.Application","IE_")

        objExplorer.Navigate "about:blank"
        objExplorer.ToolBar = 0
        objExplorer.StatusBar = 0
        objExplorer.Width = 600
        objExplorer.Height = 700
        objExplorer.Left = 350
        objExplorer.Top = 100
        objExplorer.Visible = 1

        Do While (objExplorer.Busy)
        Loop

        Set ObjDoc = objExplorer.Document

        ObjDoc.Open
        ObjDoc.Writeln "<html><h1><center>DO NOT TOUCH THE KEYBOARD OR MOUSE</center></h1>"
        objDoc.Writeln "<body bgcolor='white'>"
        objDoc.Writeln "<font face='Lucida Console,Courier,mono'>"
        objDoc.body.style.cursor = "wait"

        strDescription = "Stage " & strStage

        objDoc.Writeln "<h1>" & strDescription & "</h1><hr>"
        Call LogTheEvent(b2k, strDescription)
End Sub


I figured it out. When I write data to the form I use

objDoc.Writeln <Data Here>

Now I just add the following line to the sequence

objDoc.Body.scrollTop = objDoc.Body.scrollTop + objDoc.Body.scrollHeight
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜