Dim wp As Word.Application
Dim wd As Word.Document
Dim sel As Word.Selection
Set wp = New Word.Application
Set wd = wp.Documents.Open("e:\1.doc")
Set sel = wp.Selection
wd.Tables.Add sel.Range, 5, 5
wd.Save
wd.Close
'上面这2句只要执行任意一句都可
Set wd = Nothing
wp.Quit
Set wp = Nothing
[/Quote]
Dim wp As Word.Application
Dim wd As Word.Document
Dim sel As Word.Selection
Set wp = New Word.Application
Set wd = wp.Documents.Open("e:\1.doc")
Set sel = wp.Selection
wd.Tables.Add sel.Range, 5, 5
wd.Save
wd.Close
'上面这2句只要执行任意一句都可
Set wd = Nothing
wp.Quit
Set wp = Nothing