|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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... |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
About the ExecWB method introduce:
http://msdn.microsoft.com/library/d...hods/execwb.asp And 2 parameters introduce: http://msdn.microsoft.com/library/d.../commandids.asp http://msdn.microsoft.com/library/d...en_a2z_5k38.asp |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
Sure!Thx for you post the answer!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > how do I save a web page in VB6? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|