Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你好,
如何使用 Word VBA 代码插入另一个文档,包括其纸张大小?我的意思是,如果我插入 5 个不同纸张尺寸的文档,那么它需要位于具有这些不同纸张尺寸的主文档中。
例如:
然后在主文档中会有不同纸张设置的页面,如 A4、Letter 和 A3。
我该如何编码?
提前致谢。
我自己想出了答案,这是它的代码,
Selection.InsertBreak Type:=wdSectionBreakNextPage
你必须使用上面的代码来打破页面,然后,
Selection.PageSetup.PageHeight = <size> Selection.PageSetup.PageWidth = <size>
文档中的光标需要在特定页面上才能使上述代码起作用。
要使页面设置适用于文档的特定部分,您必须使用Selection如上所示的。
Selection