我已经创建了一份工作文件。由于公司计算机上的安全性,文档上的宏无法自动启用。
我在第1页上添加了如何启用它的说明。现在,当有人打印时,它会打印这个指令页。
我试图模拟一个宏,类似于我在下面使用的宏,为了不打印空白内容控件,将我的指令页打印为空白,但是这是无效的。
Sub PrintReport()
Dim cc As ContentControl
For Each cc In ThisDocument.ContentControls
If Left(cc.Range.Text, 19) = "Click here to enter" Then
cc.Range.Font.ColorIndex = wdWhite
End If
Next
ActiveDocument.PrintOut
For Each cc In ThisDocument.ContentControls
If Left(cc.Range.Text, 19) = "Click here to enter" Then
cc.Range.Font.ColorIndex = 15
End If
Next
End Sub
我还试图创建一个宏,使用该网站的帮助,只打印特定的页面(即。2-5)。这是行不通的。
Sub SpecialPgOnePrint()
Application.PrintOut FileName:="Visitation Report (Fillable-Final)", _
Range:=wdPrintRangeOfPages, Pages:="2-5"
End Sub
我希望能帮助你找到一种方法,不打印page1 (更好),或者B.开始在page2打印
发布于 2016-02-04 04:39:21
尝试以下几点
Option Explicit
Sub PagePrint()
With ActiveDocument
.PrintOut Range:=wdPrintFromTo, _
From:=Format(.Sections(1).Headers(1).PageNumbers.StartingNumber + 2), _
To:=Format(.Range.Information(wdActiveEndAdjustedPageNumber))
End With
End Sub
https://stackoverflow.com/questions/35184210
复制相似问题