此打印代码无法正常工作,突然停下来。我尝试使用中断模式,并发现问题与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