使用VB读取word中的表格内容到excel表格中
Sub 测试word到excel()
Dim excel As Object
Dim workbook As Object
Dim worksheet As Object
Dim i As Integer
Dim row As Integer
Dim str As String
Set excel = CreateObject("excel.application")
Set workbook = excel.WorkBooks.Open("c:\temp.xls")
Set worksheet = workbook.WorkSheets(1)
row = 2
For i = 1 To ActiveDocument.Tables(1).Rows.count
str = ActiveDocument.Tables(1).Cell(i, 3).Range.Text
worksheet.Cells(row, 1).Value = str
MsgBox "行:" & i & " 内容:" & str
row = row + 1
Next
excel.Visible = True
End Sub
# 上一篇: iphone 4s设置发彩信
# 下一篇: Extended information for this URL is not available in HttpWatch Basic Edition 的解决方案 .
文章评论 (0)
暂无评论