1
我有一个单词文档,其中包含大约1000个表格,每个表格都带有其标题。我希望将这些表分组为100个组(即每个组中有10个表),然后将每个组保存在一个新的word文档中(我保存在桌面上的“newdoc.docx”)。有没有可以帮助我做到这一点的任何VBA代码或宏中的宏?将单词表复制到一个新的单词文档中
我有一个单词文档,其中包含大约1000个表格,每个表格都带有其标题。我希望将这些表分组为100个组(即每个组中有10个表),然后将每个组保存在一个新的word文档中(我保存在桌面上的“newdoc.docx”)。有没有可以帮助我做到这一点的任何VBA代码或宏中的宏?将单词表复制到一个新的单词文档中
这里是一个片段,让你开始
Sub copyTable()
' one table is already in document
Dim srcDoc As Document
Set srcDoc = ActiveDocument
Dim destDoc As Document
Set destDoc = ActiveDocument ' same doc in this example
Dim tabl As Table
Set tabl = srcDoc.Tables(1)
Dim rng As Range
Set rng = destDoc.Range ' whole doc
rng.Collapse wdCollapseEnd ' collapse range into an insert point at end of doc
tabl.Range.Copy ' source table
' (could not figure out how to copy directly without copy/paste)
rng.Paste ' paste at insert point
End Sub