1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| ption Explicit
Private Sub ToggleButton3_Click()
Me.txtPages.Enabled = True
End Sub
Private Sub CommandButton1_Click()
If Me.OptionButton1 Then
Dim x As Boolean
x = Options.PrintBackground
' Turn off error messaging and Background Printing.
Application.DisplayAlerts = wdAlertsNone
Options.PrintBackground = False
' Print the active document.
Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
' Turn on error messaging and restore Background Printing
' to original setting.
Application.DisplayAlerts = wdAlertsAll
End If
If Me.OptionButton2 Then
x = Options.PrintBackground
' Turn off error messaging and Background Printing.
Application.DisplayAlerts = wdAlertsNone
Options.PrintBackground = False
' Print the active document.
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=False, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
' Turn on error messaging and restore Background Printing
' to original setting.
Application.DisplayAlerts = wdAlertsAll
End If
End Sub |
Partager