'此代码发布后,可随意改哈,欢迎光临我的网址导航网站 http://www.97tt.org
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
On Error Resume Next
RichTextBox1.Text = ""
Dim Tables As IHTMLElementCollection
Set Tables = WebBrowser1.Document.getElementsByTagName("Table")
Dim Table1 As HTMLTable
Dim Row As HTMLTableRow, Cell As HTMLTableCell
For Each Table1 In Tables
'Next
For i = 1 To Table1.rows.length - 2 ' 逐行处理
Set Row = Table1.rows(i)
j = 0
For Each Cell In Row.cells ' 逐列处理
RichTextBox1.Text = RichTextBox1.Text + Trim(Row.cells(j).innerText) + ","
j = j + 1
Next
' 一行处理完毕后,去除行尾的逗号并加上回车
RichTextBox1.Text = Left(RichTextBox1.Text, Len(RichTextBox1.Text) - 1) + vbCrLf
Next
Next
End Sub
1