本文介绍了仅打印某些页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案:

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开发人员网络 :

推荐答案

Range:=wdPrintRangeOfPages需要与Pages一起添加.

例如:

Application.PrintOut FileName:="", Copies:=2, Range:=wdPrintRangeOfPages, Pages:="2,6-10"

这篇关于仅打印某些页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 00:03
查看更多