Word VBA选择特定部分的特定页面

发布于 2025-01-29 02:23:05 字数 845 浏览 1 评论 0原文

我在打击代码中使用 p1s11,s9,s12 以打印第11节和第9节(完全)和第12节(完全)(完全),

Application.PrintOut OutputFileName:=FinalNamePath,
Range:=wdPrintRangeOfPages, Item:=wdPrintDocumentWithMarkup,
Copies:=1, Pages:"p1s11,s9,s12", PageType:=wdPrintAllPages,
Collate:=True, Background:=True,
PrintToFile:=False,PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0,PrintZoomPaperHeight:=0

现在我想选择第11节第9章第12节

我经常搜索了很多,我得到了以下选择,

ActiveDocument.Sections(11).Range.Select

但它也选择了整个部分

,我找到了以下选择以进行数值选择,

With ActiveDocument
.Range(.Sections(2).Range.Start, .Sections(5).Range.End).Select
Selection.Copy
End With

但它仅选择了顺序的部分(完全)

我想选择第11节第9节(完全)第12节(

完全

I use p1s11,s9,s12 in blow code to print page 1 of section 11 and section 9 (entirely) and section 12 (entirely)

Application.PrintOut OutputFileName:=FinalNamePath,
Range:=wdPrintRangeOfPages, Item:=wdPrintDocumentWithMarkup,
Copies:=1, Pages:"p1s11,s9,s12", PageType:=wdPrintAllPages,
Collate:=True, Background:=True,
PrintToFile:=False,PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0,PrintZoomPaperHeight:=0

now I want to select page 1 of section 11 and section 9 and section 12

I searched a lot and I get the below for single selection

ActiveDocument.Sections(11).Range.Select

but it selects the entire section

also, I found the below for multible selection

With ActiveDocument
.Range(.Sections(2).Range.Start, .Sections(5).Range.End).Select
Selection.Copy
End With

but it selects sequential sections only (entirely)

I want to select page 1 of section 11 and section 9 (entirely) and section 12 (entirely)

in not sequential sections

how to do this

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文