HOW TO PRINT TEXT FILE IN VISUAL BASIC 6
how print a text file and landscape/portrait mode, i am using following code but lot blank paper ejected. please give me simple and very use full method, please help me
Private Sub cmdPrint_Click()
On Error Resume Next
' If ActiveForm Is Nothing Then Exit Sub
With MDIForm1.dlgCommonDialog
.DialogTitle = "Print"
.CancelError = True
.Flags = cdlPDReturnDC + cdlPDNoPageNums
If rtfText.SelLength = 0 Then
.Flags = .Flags + cdlPDAllPages
.FontSize = 8
.Orientation = cdlLandscape
Else
.Flags = .Flags + cdlPDSelection
.FontSize = 8
.Orientation = cdlLandscape
End If
.ShowPrinter
If err <> MSComDlg.cdlCancel Then
rtfText.SelPrint .hdc
End If
End With
End Sub
Last edited by suskumarsus; February 11th, 2012 at 02:07 AM..
|