A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Read contents of web page



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 2nd 06, 06:49 PM posted to microsoft.public.outlook.program_vba
Pierre Scerri
external usenet poster
 
Posts: 23
Default Read contents of web page

Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I can
programattically extract this text from the folder itself?

Thanks

Pierre
Ads
  #2  
Old February 3rd 06, 07:00 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Read contents of web page

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I

can
programattically extract this text from the folder itself?

Thanks

Pierre

  #3  
Old February 3rd 06, 04:00 PM posted to microsoft.public.outlook.program_vba
Pierre Scerri
external usenet poster
 
Posts: 23
Default Read contents of web page

Hi Michael

Thank you for the reply. Can you point me to a small example please?

Thanks again

Pierre

"Michael Bauer" wrote:

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I

can
programattically extract this text from the folder itself?

Thanks

Pierre


  #4  
Old February 3rd 06, 05:55 PM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Read contents of web page

Am Fri, 3 Feb 2006 08:00:26 -0800 schrieb Pierre Scerri:

Private WithEvents IE As InternetExplorer

Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print pDisp.Document.Body.innerText
End Sub

Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate2 "http://www.vboffice.net"
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi Michael

Thank you for the reply. Can you point me to a small example please?

Thanks again

Pierre

"Michael Bauer" wrote:

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I

can
programattically extract this text from the folder itself?

Thanks

Pierre


  #5  
Old February 3rd 06, 06:59 PM posted to microsoft.public.outlook.program_vba
Pierre Scerri
external usenet poster
 
Posts: 23
Default Read contents of web page

Hi Michael

Thanks a lot. It worked.

Pierre

"Michael Bauer" wrote:

Am Fri, 3 Feb 2006 08:00:26 -0800 schrieb Pierre Scerri:

Private WithEvents IE As InternetExplorer

Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print pDisp.Document.Body.innerText
End Sub

Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate2 "http://www.vboffice.net"
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi Michael

Thank you for the reply. Can you point me to a small example please?

Thanks again

Pierre

"Michael Bauer" wrote:

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I
can
programattically extract this text from the folder itself?

Thanks

Pierre


  #6  
Old February 9th 06, 01:01 PM posted to microsoft.public.outlook.program_vba
Pierre Scerri
external usenet poster
 
Posts: 23
Default Read contents of web page

Hi

The website I am trying to access requires a username and password which the
website remembers, but it pops up a box to acknowledge them. I have been
trying to bypass this by using the SENDKEYS "{ENTER}" command as follows:

If IExplr Is Nothing Then Set IExplr =
CreateObject("InternetExplorer.Application")
IExplr.Navigate Url
SENDKEYS "{ENTER}"
Do ' wait till iexplore is done.
Loop Until .ReadyState = READYSTATE_COMPLETE
a = .Document.Body.innertext ' put the whole page into a string

etc.....

but it doesn't seem to work. I have tried putting the SENDKEYS in different
places, but it doesn't help.

Any ideas would be most welcome.

Thanks

Pierre

"Pierre Scerri" wrote:

Hi Michael

Thanks a lot. It worked.

Pierre

"Michael Bauer" wrote:

Am Fri, 3 Feb 2006 08:00:26 -0800 schrieb Pierre Scerri:

Private WithEvents IE As InternetExplorer

Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print pDisp.Document.Body.innerText
End Sub

Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate2 "http://www.vboffice.net"
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi Michael

Thank you for the reply. Can you point me to a small example please?

Thanks again

Pierre

"Michael Bauer" wrote:

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I
can
programattically extract this text from the folder itself?

Thanks

Pierre


  #7  
Old February 9th 06, 06:41 PM posted to microsoft.public.outlook.program_vba
Pierre Scerri
external usenet poster
 
Posts: 23
Default Read contents of web page

Update

Ok I've sorted the username/password problem. Discovered the Headers:=
parameter of webbrowser.navigate.

The problem now is this:

If IExplr Is Nothing Then Set IExplr =
CreateObject("InternetExplorer.Application")
With IExplr
.Navigate Url:=Url, headers:="Authorization: Basic XXXXXX" & Chr$(13) &
Chr$(10)
Do ' wait till iexplore is done.
Loop While .Busy
a = .Document.Body.innertext ' put the whole page into a string
....rest of code

Now this code is in a Sub which is called twice in a row with a different
URL from the same website.

The first url may be: http://fmywebsite.com/Rst/OPS/FEB/2CPT.HTM
The second url may be: http://mywebsite.com/Rst/OPS/MAR/2CPT.HTM

After the second call, 'a' is still the result of the first call. ie it
does not get updated. This only happens when I first run the program.
Subsequent double calls while the program is running, work properly.

Also, sometimes, the Do Loop While .Busy exits and the data is not complete.

Heeeeelp!!!


"Pierre Scerri" wrote:

Hi

The website I am trying to access requires a username and password which the
website remembers, but it pops up a box to acknowledge them. I have been
trying to bypass this by using the SENDKEYS "{ENTER}" command as follows:

If IExplr Is Nothing Then Set IExplr =
CreateObject("InternetExplorer.Application")
IExplr.Navigate Url
SENDKEYS "{ENTER}"
Do ' wait till iexplore is done.
Loop Until .ReadyState = READYSTATE_COMPLETE
a = .Document.Body.innertext ' put the whole page into a string

etc.....

but it doesn't seem to work. I have tried putting the SENDKEYS in different
places, but it doesn't help.

Any ideas would be most welcome.

Thanks

Pierre

"Pierre Scerri" wrote:

Hi Michael

Thanks a lot. It worked.

Pierre

"Michael Bauer" wrote:

Am Fri, 3 Feb 2006 08:00:26 -0800 schrieb Pierre Scerri:

Private WithEvents IE As InternetExplorer

Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print pDisp.Document.Body.innerText
End Sub

Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate2 "http://www.vboffice.net"
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi Michael

Thank you for the reply. Can you point me to a small example please?

Thanks again

Pierre

"Michael Bauer" wrote:

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a website
that contains a timetable in the form of text. Is there any way that I
can
programattically extract this text from the folder itself?

Thanks

Pierre


  #8  
Old February 10th 06, 07:35 AM posted to microsoft.public.outlook.program_vba
Michael Bauer
external usenet poster
 
Posts: 435
Default Read contents of web page

Am Thu, 9 Feb 2006 10:41:33 -0800 schrieb Pierre Scerri:


Why don´t you use the DocumentComplete event as shown? If that event fires
*then* the download is complete and you can navigate to another URL.

Also, a Do While loop needs 100% of your CPU time. That´s not a good idea
even if it would work.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --

Update

Ok I've sorted the username/password problem. Discovered the Headers:=
parameter of webbrowser.navigate.

The problem now is this:

If IExplr Is Nothing Then Set IExplr =
CreateObject("InternetExplorer.Application")
With IExplr
.Navigate Url:=Url, headers:="Authorization: Basic XXXXXX" & Chr$(13)

&
Chr$(10)
Do ' wait till iexplore is done.
Loop While .Busy
a = .Document.Body.innertext ' put the whole page into a string
...rest of code

Now this code is in a Sub which is called twice in a row with a different
URL from the same website.

The first url may be: http://fmywebsite.com/Rst/OPS/FEB/2CPT.HTM
The second url may be: http://mywebsite.com/Rst/OPS/MAR/2CPT.HTM

After the second call, 'a' is still the result of the first call. ie it
does not get updated. This only happens when I first run the program.
Subsequent double calls while the program is running, work properly.

Also, sometimes, the Do Loop While .Busy exits and the data is not

complete.

Heeeeelp!!!


"Pierre Scerri" wrote:

Hi

The website I am trying to access requires a username and password which

the
website remembers, but it pops up a box to acknowledge them. I have been
trying to bypass this by using the SENDKEYS "{ENTER}" command as follows:

If IExplr Is Nothing Then Set IExplr =
CreateObject("InternetExplorer.Application")
IExplr.Navigate Url
SENDKEYS "{ENTER}"
Do ' wait till iexplore is done.
Loop Until .ReadyState = READYSTATE_COMPLETE
a = .Document.Body.innertext ' put the whole page into a string

etc.....

but it doesn't seem to work. I have tried putting the SENDKEYS in

different
places, but it doesn't help.

Any ideas would be most welcome.

Thanks

Pierre

"Pierre Scerri" wrote:

Hi Michael

Thanks a lot. It worked.

Pierre

"Michael Bauer" wrote:

Am Fri, 3 Feb 2006 08:00:26 -0800 schrieb Pierre Scerri:

Private WithEvents IE As InternetExplorer

Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Debug.Print pDisp.Document.Body.innerText
End Sub

Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate2 "http://www.vboffice.net"
End Sub


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi Michael

Thank you for the reply. Can you point me to a small example

please?

Thanks again

Pierre

"Michael Bauer" wrote:

Am Thu, 2 Feb 2006 10:49:07 -0800 schrieb Pierre Scerri:

Pierre, I´d use the "Microsoft Internet Controls" to navigate to

the site
and get its content.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


Hi

I have a folder for which I have set the home page to point to a

website
that contains a timetable in the form of text. Is there any way

that I
can
programattically extract this text from the folder itself?

Thanks

Pierre


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing the Read Page Teelions Outlook - Using Forms 3 January 30th 06 03:20 PM
Saveas web page shows Appointment and Event Details Robert Grimes Outlook - Calandaring 0 January 30th 06 02:09 PM
how do I set up a calendar as a web page? VA rider Outlook - General Queries 1 January 29th 06 09:50 AM
Command button not working on read page jbtempe Outlook - Using Forms 2 January 13th 06 11:25 PM
Send Web Page by Email (hyperlinks don't work) John Reames Outlook - General Queries 0 January 13th 06 09:03 PM


All times are GMT +1. The time now is 10:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.