|
楼主 |
发表于 2023-5-5 13:18
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 复制粘贴()
- For x = 1 To 46
- Windows("文档A.docx").Activate
- i = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
- ActiveWindow.View.Type = wdPageView
- ActiveDocument.Repaginate
- Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=i
- Selection.EndKey Unit:=wdStory, Extend:=wdExtend
- Selection.Cut
- Windows("合并.docx").Activate
- Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=i * 2 + 1
- Selection.PasteAndFormat (wdFormatOriginalFormatting)
- Windows("文档B.docx").Activate
- i = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
- ActiveWindow.View.Type = wdPageView
- ActiveDocument.Repaginate
- Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=i
- Selection.EndKey Unit:=wdStory, Extend:=wdExtend
- Selection.Cut
- Windows("合并.docx").Activate
- Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:=i * 2
- Selection.PasteAndFormat (wdFormatOriginalFormatting)
- Next
- End Sub
复制代码
|
|