仅打印某些页面 [英] Print certain pages only
问题描述
解决方案:
Application.PrintOut FileName:="", Copies:=2, Range:=wdPrintRangeOfPages, Pages:="2,6-10"
原始问题:
我有下面的代码可以正常工作:
I have the following code which works fine:
Application.PrintOut FileName:="", Copies:=2
这将两次打印我的10页文档.
This prints my 10 page document twice.
我现在想使用pages
选项仅指定要打印的某些页面:
I now want to use the pages
option to specify only certain pages to print out:
Application.PrintOut FileName:="", Copies:=2, Pages:="2, 6-10"
我期望它可以将页面2和6到10两次打印出来,即2,6,7,8,9,10,2,6,7,8,9,10,但是它只打印了全部10页面两次.
I was expecting it to print out pages 2 and 6 to 10 twice, i.e. 2,6,7,8,9,10,2,6,7,8,9,10, but instead it just printed all 10 pages twice.
我在Word 2010中使用VBA.
I am using VBA in Word 2010.
知道我在做什么错吗?
资源:
来自 Microsoft开发人员网络 :
页面-可选-变体-要更改的页面编号和页面范围 印刷,用逗号分隔.例如,"2,6-10"将打印第2页, 第6页到第10页
Pages - Optional - Variant - The page numbers and page ranges to be printed, separated by commas. For example, "2, 6-10" prints page 2 and pages 6 through 10
推荐答案
Range:=wdPrintRangeOfPages
需要与Pages
一起添加.
例如:
Application.PrintOut FileName:="", Copies:=2, Range:=wdPrintRangeOfPages, Pages:="2,6-10"
这篇关于仅打印某些页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!