Dim BeginPage, EndPage, NumCopies, i
'将 Cancel 设置成 True。
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
'显示“打印”对话框。
CommonDialog1.ShowPrinter
'从对话框中获取用户选定数值。
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
For i = 1 To NumCopies
'在此放置代码,将数据发送到打印机。(这段代码怎么写啊,我想把文本框里的东西打印出来哦!!!!!!!!!!!!!) Next
Exit Sub
ErrHandler:
'用户按下了“取消”按钮。
'将 Cancel 设置成 True。
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
'显示“打印”对话框。
CommonDialog1.ShowPrinter
'从对话框中获取用户选定数值。
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
For i = 1 To NumCopies
'在此放置代码,将数据发送到打印机。(这段代码怎么写啊,我想把文本框里的东西打印出来哦!!!!!!!!!!!!!) Next
Exit Sub
ErrHandler:
'用户按下了“取消”按钮。
关于打印picture很简单了
有的是帖子找找吧
Printer.Print "Prints"
Printer.Print "A"
Printer.Print "Test"
Printer.Print "Page"
Printer.Print "In"
Printer.Print "A"
Printer.Print "Very"
Printer.Print "Tiny"
Printer.Print "Font"
Printer.Print "Huh?"
Printer.Print "lol :)"
Printer.Print "Created"
Printer.Print "By:"
Printer.Print "Conrad"
Printer.Print "Brinker"
Printer.Print "MS VB 6"
Printer.Print "[email protected]"
Printer.Print "http://www.chbrules.freeservers.com"
Printer.Print ""
Printer.Print "If you haden't figured out by now, if you can read this your printer is working! :)"
Printer.EndDoc
Printer.ScaleMode = vbCentimeters
Printer.PaintPicture Picture1.Picture, 2, 2
Printer.EndDoc
End If