Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Progress Window 1

Status
Not open for further replies.

sn0rg

IS-IT--Management
Joined
Aug 5, 2005
Messages
95
Location
GB
I'm using the following code:
Code:
Set objExplorer =CreateObject("InternetExplorer.Application")

updating it via:

Code:
objExplorer.Document.Body.InnerHTML = strInner

Once the viewable window has filled up, it isn't possible to view new window content without constantly scrolling down.

Is there a way to force the window to scroll down, to constantly view the new window content?

 
I think there is a ScrollTo mthod that may do what you want.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Thanks EBGreen - I've had a quick look around but cant find much info on that. Do you know how to implement it?

Any examples would be good.

Cheers
 
You can do it like this.
[tt]
with objExplorer.Document.Body
.InnerHTML = strInner
.scrollTo 0,.scrollHeight
end with
[/tt]
 
Amendment
Should be window's scrollto method. A re-take.
[tt]
with objExplorer.Document.Body
.InnerHTML = strInner
[red]window[/red].scrollTo 0,.scrollHeight
end with
[/tt]
 
Amendment-2

Sorry need another amendment, upon reading what I posted, it is done too quick without much thought on related matters. With window object, I was thinking inside the browser. To reference to it from the application object, I should do oie.document.parentwindow... Hence, hopefully the final re-take.
[tt]
with objExplorer.Document.Body
.InnerHTML = strInner
[red]objExplorer.document.parentwindow[/red].scrollTo 0,.scrollHeight
end with
[/tt]
To make it less swkward, may be this as well.
[tt]
with objExplorer.Document
.body.InnerHTML = strInner
.parentwindow.scrollTo 0,.body.scrollHeight
end with
[/tt]
 
Thanks, but I'm not getting anywhere. I've got "object doesn't support this property or method" when calling the window object.

Here's the full script:

Code:
	Set objExplorer	= CreateObject("InternetExplorer.Application")
	objExplorer.Navigate "about:blank"
	objExplorer.ToolBar = 0
	objExplorer.StatusBar = 0
	objExplorer.Width= 800
	objExplorer.Height = 400
	objExplorer.Left = 1
	objExplorer.Top = 1
	objExplorer.Visible = 1

	strInner = "Test Window</p>"
	objExplorer.Document.Body.InnerHTML = strInner


	X = 0

	Do while X < 100
		
		strInner = strInner & "Line: " & X & "</p>"
		
		with objExplorer
			.Document.Body.InnerHTML = strInner 
			.Document.Body.Window.scrollTo 0,.scrollHeight
		end with
		
		x = x + 1
	Loop
 
Ahh, crossed posts. Thats great, many thanks Tsuji - you always come through!
 
>[tt].Document.Body.Window.scrollTo 0,.scrollHeight[/tt]
[tt].Document.[red]parentWindow[/red].scrollTo 0,[red].body[/red].scrollHeight[/tt]
 
So lousy my editig! Just to correct my mistake, you sure have got it right already.
[tt].Document.parentWindow.scrollTo 0,[red].Document[/red].body.scrollHeight[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top