Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > BOOK: Professional VB 2005 ISBN: 0-7645-7536-8
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 11th, 2012, 01:04 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 01:07 AM.
  #2 (permalink)  
Old February 11th, 2012, 03:40 AM
Friend of Wrox
Points: 742, Level: 10
Points: 742, Level: 10 Points: 742, Level: 10 Points: 742, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2009
Location: Tehran, Iran
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

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
__________________
happy every time, happy every where

Reza Baiat
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02: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 01:09 AM
Printing problem in Visual Basic ! Urgent venkatesh_anmca Beginning VB 6 2 January 29th, 2005 01:22 AM
Automation file not supported in visual basic sush_blr Beginning VB 6 2 December 28th, 2004 01:42 AM



All times are GMT -4. The time now is 10:13 PM.


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