The script below does what I'm looking for. It finds the first instance of
the current date on the active page, scrolls it into view, and selects it.
However, I'm trying to get the date to be scrolled to the top of the page.
From what I read on MSDN about scrollIntoView, this is supposed to be the
default behavior of the command. However, it only seems to work if the date
is found above what is currently showing on the screen. If the date is
found below whats currently on the screen then the scrollIntoView seems to
default to scrollIntoView(false) with no way to change it (meaning the
object being scrolled to is always at the bottom of the screen). Is there a
workaround that can force it to the top?
By the way, I'm using this to quickly scroll to new posts in a forum I
frequent.
Thanks!
-Jeremy
---------------------------------------------------------------------------
<script language="vbscript">
Dim sDate, oRange
sDate = Right("0" & Day(Date),2) & "-" & Right("0" & Month(Date),2) _
& "-" & Year(Date)
Set oRange = document.body.createTextRange
With oRange
.findText(sDate)
.scrollIntoView(true)
.select
End With
</script>
---------------------------------------------------------------------------