Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 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 January 28th, 2005, 01:59 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing problem in Visual Basic ! Urgent

hi to all,
I have the printing problem in VB.

this is the code I've used
Public Sub test()
  Printer.ScaleMode = vbtwips
  Printer.PaperSize = vbPRPSUser
  Printer.Height = 4*1440
  Printer.Width = 6*1440
  printer.print "Hi"
  .
  .
  .
  .
  Printer.NewPage
  Printer.EndDoc
End Sub
my paper size is 4'' and I need to stop formfeed of the
printer after printing is over i.e., afte 4'' height
but
It get stuck in the line Printer.PaperSize=vbPRPSUser
the error says that Run-Time Error: '380' Invalid Property Value



 
Old January 28th, 2005, 11:59 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Help says
Quote:
quote:Setting a printer's Height or Width property automatically sets .PaperSize to vbPRPSUser
Perhaps you cannot set this particular value directly.

Try not setting it, set your paper size, then read the .PaperSize property to see if it is equal to vbPRPSUser.
 
Old January 29th, 2005, 02:22 AM
Registered User
 
Join Date: Jan 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for help, but
I have another problem

I've used this code now without vbPRPUser

Public Sub test()
  Printer.ScaleMode = vbtwips
  Printer.Height = 4*1440
  Printer.Width = 6*1440
  printer.print "Hi"
  .
  .
  .
  .
  Printer.NewPage
  Printer.EndDoc
End Sub

it formfeed the entire paper

my paper size is 4''
I need to stop formfeed after printing is over i.e., after 4'' height

Thanks in advance






Similar Threads
Thread Thread Starter Forum Replies Last Post
printing in custom paper size in visual basic imagetvr Pro VB 6 2 May 3rd, 2008 08:58 PM
problem in API programming in visual basic 2005 jatin Visual Basic 2005 Basics 2 March 16th, 2007 02:11 PM
printing problem with crystal report visual basic gajendrabang Crystal Reports 2 January 3rd, 2007 02:09 AM
Visual basic.net problem Brettvan1 VB.NET 2002/2003 Basics 14 January 24th, 2005 01:40 PM
Visual Basic Encountered a Problem and Needs to .. Niaz Pro VB 6 4 September 1st, 2004 02:34 PM





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