Wrox Programmer Forums
BOOK: Professional VB 2005 ISBN: 0-7645-7536-8
This is the forum to discuss the Wrox book Professional VB 2005 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Rama Ramachandran, Kent Sharkey, Bill Sheldon; ISBN: 9780764575365
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 11th, 2012, 02:04 AM
Registered User
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

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
.Flags = .Flags + cdlPDSelection
.FontSize = 8
.Orientation = cdlLandscape
End If
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..
Old February 11th, 2012, 04:40 AM
Friend of Wrox
Join Date: Nov 2009
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Default printer object

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


and also


happy every time, happy every where

Reza Baiat

Similar Threads
Thread Thread Starter Forum Replies Last Post
printing in custom paper size in visual basic Babet VB How-To 3 November 29th, 2013 03:06 AM
printing in custom paper size in visual basic imagetvr Pro VB 6 2 May 3rd, 2008 08:58 PM
printing problem with crystal report visual basic gajendrabang Crystal Reports 2 January 3rd, 2007 02:09 AM
Printing problem in Visual Basic ! Urgent venkatesh_anmca Beginning VB 6 2 January 29th, 2005 02:22 AM
Automation file not supported in visual basic sush_blr Beginning VB 6 2 December 28th, 2004 02:42 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.