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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh HTML Page Created Using VBScript

Status
Not open for further replies.

markhoward

Technical User
Jul 29, 2003
46
0
0
GB
I have created a script which using logic and wscript.echo commands, creates a web page

(I would run the script by creating a scheduled job in the format C:\myscript.vbs > C:\mypage.htm).

What I would like to do is add a refresh button or link to the bottom of the page which reruns the underlying logic (to refresh the report) and then reloads the page.

Sorry if I'm in the wrong forum but at a bit of a loss...

Cheers.

Mark...
 
Hello markhoward,

If I understand correctly, you are hosting the browser object from the wsh container. In this situation, it is ideal for doing such kind of work and remaining light-weight. Get hold of the application object and apply the .refresh method at the appropriate moment when you have revised and re-make the .htm.

This is how you do it.
Code:
set oIE=createobject("internetexplorer.application")

oIE.navigate "c:\mypage.htm"
do while oIE.readystate<>4 : wscript.sleep 50 : loop
oIE.visible=true

wscript.sleep 15000	'15 sec
'this is just simulating all the revision you have to make
'per user's new input etc.

oIE.refresh
wscript.echo "Page has just been refreshed."

set oIE=nothing
Of course, the refresh can be triggered by the msgbox taking in user's direction.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top