By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,066 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,066 IT Pros & Developers. It's quick & easy.

VB to refresh IE window based on caption

P: n/a
Hi, is there any way of getting my VB (6.0) program to automatically
'Refresh' an IE window that might be active (window status not applicable).
It needs to be able to determine which active IE window to refresh, based on
its caption.

For example, there is a web site that I want to keep active where I normally
have to refresh it manually before it times out (every 15 min or so). I
might be doing something else at the time so I don't want to have to refresh
it manually every time (sometimes I even forget), but I want this web page
to be remain active unless I manually close it.
Can this be done?

Please include code if possible or refer me to a site that may assist.

Regards,

Jason.
Jun 12 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
"Jason S" <js*****@iprimus.com.au> wrote in message
news:44**********@news.iprimus.com.au...
Hi, is there any way of getting my VB (6.0) program to automatically
'Refresh' an IE window that might be active (window status not applicable). It needs to be able to determine which active IE window to refresh, based on its caption.

For example, there is a web site that I want to keep active where I normally have to refresh it manually before it times out (every 15 min or so). I
might be doing something else at the time so I don't want to have to refresh it manually every time (sometimes I even forget), but I want this web page
to be remain active unless I manually close it.
Can this be done?

Please include code if possible or refer me to a site that may assist.


Easiest way is to create a frameset that includes the page you want to
update every X minutes, then include this tag in the header:

<meta http-equiv="Refresh" content="300">

Where "300" is the number of seconds before the page is automatically
refreshed. Far less overhead than trying to do it with a separate process!
Jun 13 '06 #2

P: n/a

"Karl E. Peterson" <ka**@mvps.org> wrote in message
news:e6**********@nntp.aioe.org...
"Jason S" <js*****@iprimus.com.au> wrote in message
news:44**********@news.iprimus.com.au...
Hi, is there any way of getting my VB (6.0) program to automatically
'Refresh' an IE window that might be active (window status not

applicable).
It needs to be able to determine which active IE window to refresh, based

on
its caption.

For example, there is a web site that I want to keep active where I

normally
have to refresh it manually before it times out (every 15 min or so). I
might be doing something else at the time so I don't want to have to

refresh
it manually every time (sometimes I even forget), but I want this web
page
to be remain active unless I manually close it.
Can this be done?

Please include code if possible or refer me to a site that may assist.


Easiest way is to create a frameset that includes the page you want to
update every X minutes, then include this tag in the header:

<meta http-equiv="Refresh" content="300">

Where "300" is the number of seconds before the page is automatically
refreshed. Far less overhead than trying to do it with a separate
process!


Thanks Karl, but I don't understand what you mean =( especially about the
frameset. Could you please be a little more specific? I am still learning.

Ta
Jason.

Jun 14 '06 #3

P: n/a
Karl means create your own web page that uses 'frames' (only one frame
required), and set the page for the contents portion to be the page you want
to refresh frequently. In the header for your frame page, you will add the
META tag Karl mentioned, which when displayed in the browser will reload the
page at the interval selected. You would then, instead of loading the
remote site page in the browser, load instead your local HTML fame page
file, which once loaded in the browser would do the loading and refreshing
of the remote site automatically.

Throw this in notepad, save with a html extension, and then click. It will
load yahoo, and do the same every 10 seconds until the browser is closed.

The 'trick' of this is that by using a frame you are loading the yahoo site
inside your own page, and as such you can control aspects of its display.
If you want to reload every 30 seconds, change the 10 in the META tag to 30.

<html>

<head>
<title>New Page 1</title>
<meta http-equiv="Refresh" content="10;URL=http://www.yahoo.com/">

</head>

<frameset rows="*">
<frame name="main" src="http://www.yahoo.com/" scrolling="auto"
target="_self">
<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>

</html>
--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.


"Jason S" <js*****@iprimus.com.au> wrote in message
news:44**********@news.iprimus.com.au...

"Karl E. Peterson" <ka**@mvps.org> wrote in message
news:e6**********@nntp.aioe.org...
"Jason S" <js*****@iprimus.com.au> wrote in message
news:44**********@news.iprimus.com.au...
Hi, is there any way of getting my VB (6.0) program to automatically
'Refresh' an IE window that might be active (window status not

applicable).
It needs to be able to determine which active IE window to refresh, based

on
its caption.

For example, there is a web site that I want to keep active where I

normally
have to refresh it manually before it times out (every 15 min or so). I
might be doing something else at the time so I don't want to have to

refresh
it manually every time (sometimes I even forget), but I want this web
page
to be remain active unless I manually close it.
Can this be done?

Please include code if possible or refer me to a site that may assist.


Easiest way is to create a frameset that includes the page you want to
update every X minutes, then include this tag in the header:

<meta http-equiv="Refresh" content="300">

Where "300" is the number of seconds before the page is automatically
refreshed. Far less overhead than trying to do it with a separate
process!


Thanks Karl, but I don't understand what you mean =( especially about the
frameset. Could you please be a little more specific? I am still learning.

Ta
Jason.

Jun 14 '06 #4

P: n/a

"Randy Birch" <rg************@mvps.org> wrote in message
news:44*********************@news.astraweb.com...
Karl means create your own web page that uses 'frames' (only one frame
required), and set the page for the contents portion to be the page you
want
to refresh frequently. In the header for your frame page, you will add the
META tag Karl mentioned, which when displayed in the browser will reload
the
page at the interval selected. You would then, instead of loading the
remote site page in the browser, load instead your local HTML fame page
file, which once loaded in the browser would do the loading and refreshing
of the remote site automatically.

Throw this in notepad, save with a html extension, and then click. It will
load yahoo, and do the same every 10 seconds until the browser is closed.

The 'trick' of this is that by using a frame you are loading the yahoo
site
inside your own page, and as such you can control aspects of its display.
If you want to reload every 30 seconds, change the 10 in the META tag to
30.

<html>

<head>
<title>New Page 1</title>
<meta http-equiv="Refresh" content="10;URL=http://www.yahoo.com/">

</head>

<frameset rows="*">
<frame name="main" src="http://www.yahoo.com/" scrolling="auto"
target="_self">
<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>

</html>
--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.

Hi Randy,

I tried this, and the page loaded and all, but it only refreshed *once* and
that was it. ?
It's supposed to loop is it?

Jason
Jun 14 '06 #5

P: n/a
Jason S wrote:
I tried this, and the page loaded and all, but it only refreshed
*once* and that was it. ?
It's supposed to loop is it?


Yeah, and it probably did, but since the content hadn't changed you didn't
see it. Try it on a page that changes, like this:
http://www.timeanddate.com/worldclock/
--
Jun 14 '06 #6

P: n/a

"Karl E. Peterson" <ka**@mvps.org> wrote in message
news:e6**********@nntp.aioe.org...
Jason S wrote:
I tried this, and the page loaded and all, but it only refreshed
*once* and that was it. ?
It's supposed to loop is it?


Yeah, and it probably did, but since the content hadn't changed you didn't
see it. Try it on a page that changes, like this:
http://www.timeanddate.com/worldclock/
--

Sorry Randy, but it's just not happening for me =(
I changed it to the above website like you suggested, but the times stayed
the same!
Something's wrong.

I have IE 6 with SP2. Does that make any difference?

Jason.
Jun 15 '06 #7

P: n/a
Jason S wrote:
"Karl E. Peterson" <ka**@mvps.org> wrote in message
news:e6**********@nntp.aioe.org...
Jason S wrote:
I tried this, and the page loaded and all, but it only refreshed
*once* and that was it. ?
It's supposed to loop is it?


Yeah, and it probably did, but since the content hadn't changed you
didn't see it. Try it on a page that changes, like this:
http://www.timeanddate.com/worldclock/


Sorry Randy, but it's just not happening for me =(
I changed it to the above website like you suggested, but the times
stayed the same!
Something's wrong.


Ah, I see the problem. Randy actually redirected you to the site in
question, rather than just refresh the current page. Here's a new copy of
that file. In a nutshell, change the meta tag to be more like this:

<meta http-equiv="Refresh" content="10">

Adjust the number of seconds appropriately.

Later... Karl
--


Jun 15 '06 #8

P: n/a

"Karl E. Peterson" <ka**@mvps.org> wrote in message news:e6**********@nntp.aioe.org...
Jason S wrote:
"Karl E. Peterson" <ka**@mvps.org> wrote in message
news:e6**********@nntp.aioe.org...
Jason S wrote:
I tried this, and the page loaded and all, but it only refreshed
*once* and that was it. ?
It's supposed to loop is it?


Yeah, and it probably did, but since the content hadn't changed you
didn't see it. Try it on a page that changes, like this:
http://www.timeanddate.com/worldclock/


Sorry Randy, but it's just not happening for me =(
I changed it to the above website like you suggested, but the times
stayed the same!
Something's wrong.


Ah, I see the problem. Randy actually redirected you to the site in
question, rather than just refresh the current page. Here's a new copy of
that file. In a nutshell, change the meta tag to be more like this:

<meta http-equiv="Refresh" content="10">

Adjust the number of seconds appropriately.

Later... Karl
--


Beautiful, thanks Karl and Randy =)
Have a good one

Jason.


Jun 16 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.