📄 printercontrol.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "PrinterControl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'设置打印方向的专用模块
Private PageDirection As Integer
Public Sub ChngOrientationLandscape()
If Printer.Orientation = 1 Then
Fangxiang = True
ElseIf Printer.Orientation = 2 Then
Fangxiang = False
End If
PageDirection = 2
Call SetOrientation(DMDUP_SIMPLEX, PageDirection)
End Sub
Public Sub ReSetOrientation()
If Fangxiang = True Then
PageDirection = 1
Else
PageDirection = 2
End If
Call SetOrientation(DMDUP_SIMPLEX, PageDirection)
Printer.EndDoc '如无此句,printer.orinentation等值将不同时改变。
End Sub
Public Sub ChngOrientationPortrait()
If Printer.Orientation = 1 Then
Fangxiang = True
ElseIf Printer.Orientation = 2 Then
Fangxiang = False
End If
PageDirection = 1
Call SetOrientation(DMDUP_SIMPLEX, 1)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -