View HTML Source

'Add 1 Text Box and 1 Command Button to your form. Set Text Box MultiLine property to True.
'Add 1 WebBrowser Control to your form (Select from the menu Project->Components, Then
'Select Microsoft Internet Controls, and press OK)
'Insert this code to your form:

Dim FileName As String
Private Sub Form_Load()
'Replace 'c:\HtmlFile.htm' with the name of the HTML file you want to view his source.
FileName = "c:\HtmlFile.htm"
WebBrowser1.Navigate2 (FileName)
End Sub

Private Sub Command1_Click()
Open FileName For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1
End Sub

Go Back