Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo
another way to using the common dialog for printing
Highlight all by clicking in box
Private Sub mnuPrint_Click()
On Error Resume Next
.DialogTitle = "Print"
.CancelError = True
.Flags = cdlPDReturnDC + cdlPDNoPageNums
If RTF1.SelLength = 0 Then
.Flags = .Flags + cdlPDAllPages
.Flags = .Flags + cdlPDSelection
If Err <> MSComDlg.cdlCancel Then
Printer.CurrentX = 1440
Printer.CurrentY = 1440
Printer.FontSize = 10
Printer.Print RTF1.Text; .hDC
' allows the user to push cancel on printer dialog
'On Error Resume Next
'.DialogTitle = "Print"
'.CancelError = True
' Prepare to print using the printer object.
'.PrinterDefault = True
' We need to know whether the user decided to print.
'If Err <> MSComDlg.cdlCancel Then
'Printer.CurrentX = 0.2 ' 1440 in twips is 1" margin
'Printer.CurrentY = 1.25
'Printer.FontSize = 10
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.