vbscript如何强制IE滚动条锁定到底部

发布于 2024-11-06 02:46:50 字数 1141 浏览 2 评论 0原文

我使用 IE 作为提供运行进程反馈的表单。随着进程的更新,它们最终会超出窗口大小。我想要发生的是 IE 窗口将锁定到页面的底部而不是顶部,因此当数据出现时它会向下滚动 - 几乎就像“尾部”功能

这就是我用来创建 IE 窗口的方法我将数据注入

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

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 top, 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

‖放下 2024-11-13 02:46:50

我想通了。当我将数据写入我使用的表单时

objDoc.Writeln <Data Here>

,我只需将以下行添加到序列中

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文