Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Printing On Pre-Printed Forms

I have an app which allows users to fill in medical forms. I have images of these forms on the screen and the users fill in the appropriate details ie. textboxes and tick marks (which are images). The forms are larger than the screens. I need to print the user inputs on the pre-printed forms. I have tried using the printform method but only the sections visible on the screen are printed.

I may also need to allow the users to align the printing. Has anyone done something similar?


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Over Printing Pre Printed Forms
i want to get my program to fill in the boxes on a pre-printed form.

I am using the currentX and currentY properties to position the the text insertion point. What I've noticed is that increasing the x and y properties by the same amount does not always have predictable results.

If say increasing the vaue of currentY by K moves the text down 1cm, then increasing it by a further K moves it down further a little more than 1cm and the the discrepancy increases with every increment.
This makes positioning text very difficult

Why is this? Could it just be a problem with my printer?

Reports And Printed Forms
What is the best method to use for writing reports and printed forms (invoices, Po's) for data tables managed by my VB6 application?

Printing In Pre Printed Paper
Hello Friends

I need help in printing in DOT MATRIX PRINTER, PrINTED IN PRE PRINTED SHEED (Bill Printing)

Paper HEight =6 inches
Paper width = 9.1 inches

I wish to print date in ( from top 1.6 inches, from left of paper 2 inches )
I wish to print bill no in ( from top of paper 1.6 inches, from left of paper 2 inches

Like that in print matter in pre printed sheet , It is continous sheet so printing stop and printing, and new bill printed in next paper

senthil kumar

Printing To A Printed Document
I need to gather data from the database, format it and send
it to the printer so that each piece of text prints in its correct
position on a federal form. What tools, methodologies should I be investigating?

Printing In Pre Printed Paper
Dear friends,

Help in to print Pre printed stationer using visual basic. I have a paper size 6" inches height and 9.1 inches width. (continuous stationer)

How can i set Printer.PaperSize = ?

Now i give print some first bill printed and 1 or 2 paper skips. I hope it is due to
not fixing or correct paper size.

Please explain me how can i put paper size ?

senthil kumar.A

Printing In A Pre Printed Paper
hi, i want to printout some data on a pre printed paper which has some exact locations where i have to put in the datas while printing. How can i do that. Can anyone give me the code or sample programs , how to do it... and i want to know is it possible to do it by using Crystal report or data report. plz if anyone knows, give me some insight into this..

Thanks in advance

Printing Into Spaces On Pre-printed Form
The title says what I am trying to do. The dot matrix printer does not load the printed form to exactly the same spot each time, so I have to have both a horizontal and a vertical adjustment before starting to print. In VB3 I printed a diagonal scale on the document, stopped, and adjusted the print location based on the points on the scale that hit a reference point on the document. But I can't get VB4 to print that scale and stop. When I use "enddoc" the page is ejected after the scale is printed. Any suggestions on how to print character(s) on the document then stop and allow the position of the subsequent printing to be adjusted based on where that character appears on the document? Or some other way to be sure I hit the right spaces with my printing?

Printing A VB Form Comes Half Printed
Pls help me to solve this unusual prob :

First of all I design a form in VB with labels, texboxes, lines etc. Now when I try to print this form it sometimes prints correctly ie full page and at times it gives me a half page printing.

I have tried to debug this prob. But the prob is I am unable to understand why and when it comes.

Pls help me.

Continuous Printing On A Pre-printed Paper
I am trying to Print Bills in continous pre-printed paper (which has two bills in a single page) using a Dot Matrix printer. Using an 80 column sheet
I am able to print the first page, but when trying to print the second page, the printing starts from a different position in the continous sheet
But when I print the same bills (4 bills, 2 bills in a single sheet) two sheets seperately I am able to print properly

Below is the code
Please help and let me know the code changes


Private Sub Command3_Click()
' Print Invoice

Set PRN = Printer
PRN.ScaleMode = 6

PrintInvoice (0)
PrintInvoice (152)
PrintInvoice (0)
PrintInvoice (152)

End Sub

Private Sub PrintInvoice(setStartSize As Integer)

Dim setNextSize As Integer
setNextSize = setStartSize

PRN.Font.Italic = False
PRN.Font.Bold = False
PRN.Font.Size = 8

' Position title on the page
PRN.CurrentX = 184: PRN.CurrentY = (36 + setNextSize)
PRN.Print "10"

PRN.CurrentX = 79: PRN.CurrentY = (45 + setNextSize)
PRN.Print "Ramesh Sippy"
PRN.CurrentX = 184: PRN.CurrentY = (45 + setNextSize)
PRN.Print "25/02/2006"

PRN.CurrentX = 76: PRN.CurrentY = (53 + setNextSize)
PRN.Print "My Company Pvt Ltd"
PRN.CurrentX = 184: PRN.CurrentY = (53 + setNextSize)
PRN.Print "Travel"

PRN.CurrentX = 160: PRN.CurrentY = (103 + setNextSize) ' Service Tax
PRN.Print "Service Tax (1.2%)"

PRN.CurrentX = 199: PRN.CurrentY = (103 + setNextSize) ' Service Tax
PRN.Print "250.00"

PRN.CurrentX = 22: PRN.CurrentY = (113 + setNextSize) ' Total in words
PRN.Print "Twenty two Thousand Five hundred only"

PRN.CurrentX = 199: PRN.CurrentY = (113 + setNextSize) ' Total
PRN.Print "22500.00"

End Sub


Printing From A Forms Textbox To A Different Forms Label
Well i have a problem, i have no problems printing labels that are on other forms but i do with text boxes...

lets say i have form1 and form2 on form1 i have a textbox (txtBox) then on form 2 i have a label (lblLabel) i want to print the content of txtBox in lblLabel how do i do this if possible? do i have to store it in a variable before i take it across to print?

Printing Forms
My program has controls(text and graphics) on 2 VB Forms (front and back). I need to be able to print them out to a double-sided page.
Using Printform has good picture quality results but cannot get to print the second form on the back of the page. My default printer is setup to handle 2 sided printing.
I have also used the BitBlt method to create DIBs of the forms, then convert to a PictureBox.Picture to allow using PaintPicture() to print the images. I am able to print on both sides this way but the text on the forms have the same jagged edges that appear on the screen (unlike the PrintForm option).

Is there any way to make PrintForm print to both sides? Or can PrintForm be directed to a graphic file that will have the smooth edges?
I have to turned on Windows Font Smoothing and it helped some but because some of the smaller text becomes blurry this is not a good option.

Any options would be appreciated.

Printing Two Forms
I dont see how you change the position of the form. When you use prinform method. It will printed in the up left corner. I expect with this code you can center it on the print output. But I can not see how you can arrange that.


Printing Two Forms
on one print page.

CurrentX = 20
CurrentY = 20

prints on two different pages.

It seems that printform executes an enddoc at the back of its routine.

Is there a way to print two forms on one page?

Printing Forms In Vb6
This is the first time that Ive had to print forms in vb, and Im have real probs. When i use the <<formname>>.PrintForm command, it only prints off the part of the form that is visible on the screen.

The problem that Ive got at the moment, is the form will more than likely be about 2 pages long.

Can anyone help!!!

Printing Forms
Probably as simple one but, how can you get a form to fill a sheet of A4 when printed out. All I ever seem to get is a form printed in the Top Left corner.

Please help.

Printing Forms

Can anyone show me how to format and send my form for printing? Don't really know where and how to go about it.



Printing Forms
For some reason, I can't seem to print the same form twice. Even if after it's unloaded and reloaded, it still wont print until I re-run the program.

dlg.CancelError = True
On Error Resume Next
Printer.PrintQuality = 4
If Err = 32755 Then
Exit Sub
End If
Printer.Orientation = 1
dlg.PrinterDefault = True


Regarding Printing Forms
Hello Friends

Here i am suffering with a problem.
I have created a project which consists of different forms like image,textdoc,tabs(some columns under tabs),Login box,windowsplitter,etc.
At run time user can ask any of them to be printed.
When iam going to print image'(i.e is in splitter window,image appears in right side pane)
the problem is iam using printform method,& with this iam not able to print complete image(i.e scroll bars are there but it is not taking complete image).It is just printing which is visible to us.

And When i want to print textbox it is also printing the same,which is visible to us.
Please tell me how to solve this.
And one more question..How to preview the document to be printed?Is there any method in VB6.(printpreview)


Printing Forms
How can I set the cordinates of a form for printing? Form1.PrintForm prints only the visible part of the form. How can I print the lower part also?

Thanks in advance

Printing Forms In VB
I am currently writing a program for a company and want to be able to print a "receipt" for the customer for work that was done. I put in the code for printing the screenshot, but I don't want the background color of the form to come through as that would eat up the ink or the text boxes and buttons to show up either. I just want the labels and text inside the text boxes to print on white paper. I would also like to keep the printed copy in the same format as the form itself. I may be in over my head on this one, but I was hoping that somebody would know.

Thanks in advance....

Printing Forms
wat i have is this certificate of completion that has the option to be printed off. i've looked up printing codes but now when it prints the form (which is wat i want) but also prints the command buttons (which i don't want) n e way to fix this or can't be helped?

Printing Forms
how will I print the form not including the command buttons??????

also how will I put a picture into a command button? I try to use the Picture property but it doesnt work.. please help.. thanks...

Printing In Various Forms
Hi all
I have yet another question!(Jona listens for sighs) Right.... What i want to do is physically print some text on a printer. I want to use windows default printer. I have very basic code:

Private Sub Command1_Click()
End Sub

But that prints the form and i don't want to be wasting all my printer ink on the random grey bits. So how do i send a line of text to the printer........I will need to send multipul lines of text on the same page.... any ideas ?


Printing Forms
I wish to print a form as it is displayed on the screen, ie with caption (title bar). The "printform" method prints only the contents of the form and if I add "printer.print caption" then the caption prints on a new page.

How do I print it all together, ie caption + form ?

Thank you for your time, Bob.

Printing Forms
[i][size=1][font=courier new][color=darkblue]
I have a program that prints 3 forms this forms are hidden from the user and the only thing that I do is call the form, charge the values for text fields and print (form1.printform), my problem is that not always prints ok, at times it print only a part from the form.

Do you know what can I do??


Printing Forms?
I have a graph and a datagrid that correspond to each other on a form. I want to print the form so that I can see both. If I have my graph the size I want it takes up about 3/4 of the screen. Then when I print it out it cuts half of the data grid below it but only uses 1/2 of the paper(8 1/2 x 11 portrait). Is there anyway to scale the form objects so they print out on a full piece of paper?

Printing Forms
I have written a program that calculates alot of data. I added a print feature that would place this data on a excel spreadsheet so that when the data is printed it has a professional "office form" type appearance. The problem comes when the user doesn't have excel installed on his/her computer. I have tried the print form method and got the same results many of you have with the partial form printout. I was wondering if anyone knew of an easier way to make an "office type form" with lines and labels that would give me the same appearance as my excel spreadsheet.

Thanks in advance.

Printing Forms
Please help. I have a database populated form (all the data is in labels) and I'd like to print the form on letterhead. I have tried using: printer.print <label.caption> but the text prints out across the page in one long line. I've also tried: formName.currentx = 1440, formName.currenty = 2880, formName.printform - but I cannot get the image to move down on the printed page. Any help would be much appreciated.

Thank you.

Printing Forms

I'm trying to print serial numbers to a voucher with a size of about 1/4 of a bond paper and it is like a continuous form. How can i program vb to print serial numbers exactly to the space provided in each voucher?

please help

Printing Forms
I have found this printform option and it works.. my question is there any alteration I can make to this code so it prints landscape ONLY??

Private Sub CmdPrint_Click()
    Dim Msg ' Declare variable.
    On Error GoTo ErrorHandler ' Set up error handler.
    PrintForm ' Print form.
    Exit Sub
    Msg = "The form can't be printed."
    MsgBox Msg ' Display message.
    Resume Next
End Sub

I have just found this but not sure how to impliment it into the code I have or even if it is possible...

object.Orientation [= value]

The Orientation property syntax has these parts:

Part    Description
object    An object expression that evaluates to an object in the Applies To list.
value    A value or constant that determines the page orientation, as described in Settings.

The settings for value are:

Constant    Value    Description
vbPRORPortrait    1    Documents are printed with the top at the narrow side of the paper.
vbPRORLandscape    2    Documents are printed with the top at the wide side of the paper.

What do I dim object as????

I am a VB learner with huge ideas!! push yourself and you shall learn more

First Project: (Forever GROWING!!)

I aim to assist the Ten Pin Bowling Instructors around the world with this!!!!

Edited by - EPOS on 1/19/2005 8:58:29 AM

Printing Forms
I'm having trouble printing out a MSFlexGrid. I really don't have any experience printing stuff out at all. This is a large grid, right now it's at 50 rows, and it will probably get up to around 400 or more. I know I'm not being too specific here, but that's mainly cause I don't really know what information people would need

If anyone has a general idea, or even a specific one, I would be most appreciative.

Printing Forms ?
I'm having a problem trying to print a form using PRINTFORM on one particular printer.

For some reason on this printer, it's cutting the form short at a height of 9240. The form is actually 9600 in Height. The printer object height is 15940 (11"). Why would the printer and/or system be printing just to 9240?

Thanks in advance for any help.


Printing Forms In VB5
I think this has already been mentioned somewhere but I am unable to find it..

I have been searching to find out how to change the oritenation in VB5 of a page when printing using Printform.orientation..

Apparently VB 5 does not support this line of code according to the MS website. the only way they offer to get around it is to install another printer on your machine and set it to print LANDSCAPE as default.. So basically you have to choices of printer for the 1 actual printer...

Hope this helps someone as it baffled me for a few months!!


I am a VB learner with huge ideas!! push yourself and you shall learn more

First Project: (Forever GROWING!!)

I aim to assist the Ten Pin Bowling Instructors around the world with this!!!!

Edited by - EPOS on 3/9/2005 9:02:57 AM

Printing To Forms
I am printing to a blank form and using it as a basic form of Print Preview. However, if a window is opened over the form then the print under the window disappears when the window is closed. Can anyone tell me why this is happening and how to stop it. Also if anyone knows of a more robust method of creating a print preview I would be very grateful

Many thanks


Printing Forms In VB
When printing a form with this:
The app causes ipf's, only when under win9x, not in winnt/2k!!!



Printing Forms
I need to print many forms from VB application. Some dinamic data will be get from SQL database, but I don't want to connect some printing object with my databaze - I wanna to be able to send data from VB to some print form object. One way (bad way) is with print object, but is very slow for coding and it's very difficoult for making corrections in future.
Other way (very good,intelligent, I think) is to draw forms in Excel(each sheet is one form) document (only one document) and then print from this Excel object. Two problems: 1. it's slow, 2. When I close this Excel object it ALWAYS ASK me: "Do u wanna save this document!!!", cause I had put on object some data (data from SQL) in VB.
Does anyone know some good solution for printing forms in VB? What about MS Data Report? Forms also got few pictures (this souldn't be problem)...


Printing Access Sub Forms
Hi can anybody help please,

I am having trouble printing an Access 97 subform. If I print the main form, the subform's textboxes have no values, and if I put a print button on the subform, the text box values are printed as 0.

Does anybody know how to print the sub form along with the correct data in the text boxes?


Printing Official Forms
My programming skill (VB6) in printing stinks. Where can I learn to program my printing to make the printout resemble an official form (e.g., tax return) complete with boxes and checkboxes etc.

Is there a good tutorial ook out there?

Right now I am limited to printing lines of text.


Printing On Preprinted Forms
I have an image of as preprinted form on a VB form. The fields look aligned when viewed on the screen. However, when I print the image, the text does not quite line up on the actual form. Can anyone help please?

Printing Multiple Forms
is there a way to have multiple forms be printed out on one page? I have three different forms and would like them to be printed all on one page and I know how to print a single form, but not multiple at once. Thanks!

Printing MDIchild Forms
I am trying to print MDI child forms using the PrintForm method. The problem that I am having is that it always prints the forms "normal" window state, even if the window is currently maximized. What I want to do is print (whichever child form currently has focus) in it's maximum window state, regardless of it's current window state.

I have tried to set the window state to maximum, which does change the actual window state, but still prints the normal window state.

Any input is greatly appreciated.


Printing 2 Forms On Same Page...

I know this is probably quite elementary but I have 2 forms (both to fit on 800x600 screens) and when I fire the PRINTFORM command on both of them, they obviously print nicely on 2 separate pages but each print job only takes up the top half of each page. I was wondering if there was a simple way to print the first form on the top half of the page and the second form on the bottom half of the page. This would save the wasted space on the bottom half of the two printed pages and amalgamate all of my information to one printed page. Any suggestions?

Printing Forms And A4 Size ????????
I have created a form that will not be seen but is designed in aproximatly A4 proporsions.

Now I have Hack’s excellent code for printing a form but this prints the form in which the code is written.

Private Declare Sub keybd_event Lib "USER32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_MENU As Byte = &H12
Private Const VK_SNAPSHOT As Byte = &H2C
Private Const KEYEVENTF_KEYUP = &H2

Private Sub Command10_Click()

Dim lWidth As Long, lHeight As Long
Call keybd_event(VK_MENU, 0, 0, 0)
Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0)
Call keybd_event(VK_MENU, 0, KEYEVENTF_KEYUP, 0)
If Width > Printer.ScaleWidth Then
lWidth = Printer.ScaleWidth
lHeight = (Printer.ScaleWidth / Width) * Height
lWidth = Width
lHeight = Height
End If
Printer.PaintPicture Clipboard.GetData, 0, 0, lWidth, lHeight

End Sub

Now how do I

1.Get this code to print the form I want it too, not the form I call it from

2.Get the print output to strech to fill an A4 page

Printing Forms, Databases.
Hello, I want to create a loop which will cycle through my database end pick out every record that has a date which is a month previous to the current one, I have succesfully got my program to get 1 field out, the event, but I need to my program to change the captions of other labels and it doesn't seem to be doing it.

here is my code.

VB Code:
Function getDetails()Dim found As BooleanDim currentMonth As IntegertblBooking.MoveFirsttblCustDetails.MoveFirsttblPrices.MoveFirst found = False currentMonth = DatePart("m", Date)         Do Until tblBooking.EOF And tblCustDetails.EOF            If DatePart("m", tblBooking!Date) = currentMonth - 1 Then                frmBill.PrintForm            End If            tblBooking.MoveNext            Call showRec        LoopEnd FunctionFunction showRec()    lblFirstName = tblCustDetails!FirstName    lblSurname = tblCustDetails!Surname    lblAddress = tblCustDetails!Address    lblPostcode = tblCustDetails!Postcode    lblEvents.Caption = tblBooking!eventname    lblCost.Caption = "£" & tblPrices!PriceEnd Function

Sorry if my explanation was a little unclear

Fine Art Of Printing Forms
Is there someplace I could get some major help on how to print forms other than the form1.print method? I know I should be using the printer object but have not gotten anywhere on it. I could definately use a good walk through. I have forms with flex grids, listboxes, frames...etc.

thx so much

Ms Outlook Forms Printing Help
I have been working with Outlook forms for a good 4 months now, among other projects here at work. I have a CUSTOM FORM with a CUSTOM BUTTON problem.

I wrote a VBSCript Code on a POST-item object that allows the printing of the information in the Outlook Form via a Word Document Template.

Now...I just had to redesign the form in a MAIL-item object. Problem is...the Custom PRINT FUNCTION does not work!!!

I made sure that all the items in the Outlook form are LOCAL to the form so I could call-on each object. Here's a wierd thing (i found it wierd)...once I open the custom form...I have to go click TOOLS>>FORMS>>DESIGN THIS FORM...and then I Hit TOOLS>>RUN THIS FORM (which then instantiates the form in RUn Time)..and when I click on my custom PRint PRINTS (using the Word Document template).

I NEED HELP. What's happening here...and what do I need to do to make it work properly???


I posted this in the ASP I tried posting it here, coz maybe i posted this in the wrong section after all.

Printing Forms Quick Help ??

I need to print a User control with different data 3 times on one A4 page. When I place the User control on the form and use printform the max height I can print is 9000.

Anyone got any code to push these controls to a printer PLEASE??

Otherwise I'll hafta re-do the lot in Access and don't really have time ? (Deadline end of today).

Many thanks


Centering Forms For Printing
I have a bunch or forms in my exe, how can I have them centered when printing them? I have a print button that works but it puts them in the top left of the page.

Printing Forms &amp; Printform
Dear VB Gurus

Can someone plase help me. I need to print a form that is not the current form and does not have focus. I tried setting up the form and then issueing the PrintForm statement, which worked fine only the whole form doesn't get printed and it cuts off a fair portion of the bottom.

Does anyone know if a printScreen style bitmap can be produced of a Form that doesn't have focus, I have tried a few methods suggested in the forums and they all seem to work with the current form on display, and I do not have the coding experience to change them (if its possible) to capture the hidden form instead of using PrintForm. At least then I can use the printer Scaling setup so the bitmap will print reduced if need be. If not does anyone have a better method of solving this problem as it driving me crazy!!

Can anyone help!

Thanks in advance

Copyright © 2005-08, All rights reserved