|
发表于 2016-5-20 15:37
|
显示全部楼层
本楼为最佳答案
- Sub Macro1()
- Dim wd As New Word.Application
- mypath = ThisWorkbook.Path & ""
- wj = Dir(mypath & "*.doc")
- n = 1
- Do While wj <> ""
- n = n + 1
- With wd.Documents.Open(mypath & wj)
- Cells(n, 1) = Application.Clean(.Tables(1).Cell(8, 2).Range)
- Cells(n, 2) = Application.Clean(.Tables(1).Cell(8, 4).Range)
- Cells(n, 3) = Application.Clean(.Tables(1).Cell(8, 5).Range)
- Cells(n, 4) = Application.Clean(.Tables(1).Cell(15, 3).Range)
- Cells(n, 5) = Application.Clean(.Tables(1).Cell(15, 5).Range)
- .Close False
- End With
- wj = Dir
- Loop
- wd.Quit
- End Sub
复制代码 |
|