Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 8th, 2004, 01:38 AM
rabid lemming rabid lemming is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: UK
Posts: 17 rabid lemming User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 23 sec
Reputation Power: 0
Send a message via MSN to rabid lemming
Question how do I save a web page in VB6?

hi,

I have made a web browser with visual basic 6, i want to be able to save the web page using the common dialog box,

Before when I made paint program I used:

-----------------------------------------------------------------------------------
CommonDialog1.ShowOpen
picCanvas.Picture = LoadPicture(CommonDialog1.FileName)
-----------------------------------------------------------------------------------

so this time I am trying to use the same sort of thing:

-----------------------------------------------------------------------------------

CommonDialog1.ShowOpen
WebBrowser1.Document = LoadDocument(CommonDialog1.FileName)
-----------------------------------------------------------------------------------


But it doesn’t work, can any one help me please?

many thanks in advance

Reply With Quote
  #2  
Old January 8th, 2004, 11:57 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
This property is read-only..U can get it from msdn:http://longhorn.msdn.microsoft.com/...p/document.aspx
U can change Document to DocumentText...

Reply With Quote
  #3  
Old January 9th, 2004, 12:00 AM
rabid lemming rabid lemming is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: UK
Posts: 17 rabid lemming User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 23 sec
Reputation Power: 0
Send a message via MSN to rabid lemming
hi,

its ok i found out the answer

Private Sub FileMenuSave_Click()
WebBrowser1.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT
End Sub

i found you can save a web page

cheers

Reply With Quote
  #4  
Old January 9th, 2004, 02:35 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig

Reply With Quote
  #5  
Old January 9th, 2004, 03:35 AM
rabid lemming rabid lemming is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: UK
Posts: 17 rabid lemming User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 23 sec
Reputation Power: 0
Send a message via MSN to rabid lemming
hi,

I also worked out how to use the code for a print and print preview:

Private Sub FileMenuPrint_Click()
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DODEFAULT
End Sub

Private Sub FileMenuPrintPreview_Click()
WebBrowser1.ExecWB OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT
End Sub

And I got it to open a web page:

Private Sub FileMenuOpen_Click()
On Error GoTo errorhandler:
Dim FileName As String
CommonDialog1.ShowOpen
txtURL.Text = (CommonDialog1.FileName)
Call WebBrowser1.Navigate(txtURL.Text)
Part2
errorhandler:
'User Pressed Cancle
End Sub

I have also worked out how to make a scroll bars for a list box although I did it the hard way:

Private Sub FavHozScroll_Change()
FavHozScroll.Max = 14835
FavHozScroll.Min = 1335
Favourites.Width = FavHozScroll.Value
If Favourites.Width = 1335 Then
Favourites.Left = 0
End If
If Favourites.Width = 1835 Then
Favourites.Left = -488
End If
If Favourites.Width = 2335 Then
Favourites.Left = -995
End If
If Favourites.Width = 2835 Then
Favourites.Left = -1495
End If
If Favourites.Width = 3335 Then
Favourites.Left = -1965
End If
If Favourites.Width = 3835 Then
Favourites.Left = -2480
End If
If Favourites.Width = 4335 Then
Favourites.Left = -2980
End If
If Favourites.Width = 4835 Then
Favourites.Left = -3470
End If
If Favourites.Width = 5335 Then
Favourites.Left = -3985
End If
If Favourites.Width = 5835 Then
Favourites.Left = -4500
End If
If Favourites.Width = 6335 Then
Favourites.Left = -5015
End If
If Favourites.Width = 6835 Then
Favourites.Left = -5510
End If
If Favourites.Width = 7335 Then
Favourites.Left = -5990
End If
If Favourites.Width = 7835 Then
Favourites.Left = -6500
End If
If Favourites.Width = 8335 Then
Favourites.Left = -7000
End If
If Favourites.Width = 8835 Then
Favourites.Left = -7470
End If
If Favourites.Width = 9335 Then
Favourites.Left = -7980
End If
If Favourites.Width = 9835 Then
Favourites.Left = -8505
End If
If Favourites.Width = 10335 Then
Favourites.Left = -9000
End If
If Favourites.Width = 10835 Then
Favourites.Left = -9500
End If
If Favourites.Width = 11335 Then
Favourites.Left = -10000
End If
If Favourites.Width = 11835 Then
Favourites.Left = -10500
End If
If Favourites.Width = 12335 Then
Favourites.Left = -10950
End If
If Favourites.Width = 12835 Then
Favourites.Left = -11475
End If
If Favourites.Width = 13335 Then
Favourites.Left = -11985
End If
If Favourites.Width = 13835 Then
Favourites.Left = -12495
End If
If Favourites.Width = 14335 Then
Favourites.Left = -13010
End If
If Favourites.Width = 14835 Then
Favourites.Left = -13500
End If
End Sub

and

Private Sub FavVerScroll_Change()
Dim count As Integer
For count = 0 To Favourites.ListCount - 1
FavVerScroll.Max = Favourites.ListCount - 1
FavVerScroll.Min = 0
Next count
count = FavVerScroll.Value
Favourites.Text = Favourites.List(count)
End Sub

and

Private Sub Favourites_DblClick()
Call WebBrowser1.Navigate(Favourites.Text)
' if txtURL is not empty, go to URL specified in txtURL
On Error Resume Next
Dim count As Integer
For count = 0 To txtURL.ListCount - 1
If txtURL.List(count) = txtURL.Text Then
'nothing
Exit Sub
End If
Next count
Part2
End Sub

and finally

Private Sub Part2()
txtURL.AddItem txtURL.Text
txtURL.SetFocus
End Sub


I thought that this might help out others who may come across the same problems as me

cheers

Last edited by rabid lemming : January 9th, 2004 at 03:38 AM.

Reply With Quote
  #6  
Old January 9th, 2004, 03:36 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
Sure!Thx for you post the answer!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > how do I save a web page in VB6?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT