VBA中的Word打印代码停止工作

时间:2019-02-19 21:47:13

标签: vba printing ms-word

此打印代码无法正常工作,突然停下来。我尝试使用中断模式,并发现问题与PrintOut一致。无需指定范围即可使用,并打印文档的两个完整副本。

ActiveDocument.Range.Select
Selection.Find.Text = "Instructions"
blnFound = Selection.Find.Execute
endCount = ActiveDocument.ComputeStatistics(wdStatisticPages)
startCount = Selection.Information(wdActiveEndAdjustedPageNumber)
pag1 = startCount & "-" & endCount - 1
pag2 = endCount & "-" & endCount
Application.PrintOut FileName:="", Copies:=2, Range:=wdPrintRangeOfPages, Pages:=pag1

0 个答案:

没有答案