p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 (http://p2p.wrox.com/book-professional-vb-2005-isbn-0-7645-7536-8-227/)
-   -   PRINTING TEXT FILE VISUAL BASIC 6 (http://p2p.wrox.com/book-professional-vb-2005-isbn-0-7645-7536-8/86628-printing-text-file-visual-basic-6-a.html)

suskumarsus February 11th, 2012 02:04 AM

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

irProject February 11th, 2012 04:40 AM

printer object
 
Hi my friend
you can use 'printer' object. it manages printer and printing with a set of methods and properties

http://www.vb6.us/tutorials/printing...printer-object

and also

http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx

sample:
http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx


All times are GMT -4. The time now is 11:28 PM.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.