我想定义两个Printer Printer a 指定一个打印机 Printer b 指定另一台打印机 我的计算机上装了两个打印机
“工程”->“部件”,选择“Microsoft Common Dialog Control 6.0” Private Sub Command1_Click() On Error Resume Next With CommonDialog1 .DialogTitle = "打印机选择" .CancelError = True .Flags = cdlCFBoth .ShowPrinter If Err.Number = 0 Then Printer.ScaleMode = vbMillimeters Printer.CurrentX = 20 Printer.CurrentY = 30 Printer.FontSize = 20 Printer.Print "Hello,world" Printer.EndDoc End If End With End Sub
用其tools
activereport
Printer a 指定一个打印机
Printer b 指定另一台打印机
我的计算机上装了两个打印机
Private Sub Command1_Click()
On Error Resume Next
With CommonDialog1
.DialogTitle = "打印机选择"
.CancelError = True
.Flags = cdlCFBoth
.ShowPrinter
If Err.Number = 0 Then
Printer.ScaleMode = vbMillimeters
Printer.CurrentX = 20
Printer.CurrentY = 30
Printer.FontSize = 20
Printer.Print "Hello,world"
Printer.EndDoc
End If
End With
End Sub