|
楼主 |
发表于 2023-5-5 13:17
|
显示全部楼层
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 |
|