-
Does anyone know how to align things on a page while printing in vb?
sample page i want to print "dog" and "cat" in different places on the page.
---------------
| |
| Dog |
| |
| |
| Cat |
| |
---------------
is there a way i can have them print in a certian part of the page?
thansk yall
-
i guess yall will have to ignore my attempt at an exapmle.
-
Spaces!!!!
Try this
Code:
OutString = String(27,"-")& vbCrLf
OutString = OutString & "|" & space(25) & "|" & vbcrlf
OutString = OutString & "|" & text1.text & space(25-len(text1.text)) & "|" & vbcrlf
OutString = OutString & "|" & space(25) & "|" & vbcrlf
OutString = OutString & "|" & text2.text & space(25-len(text2.text)) & "|" & vbcrlf
OutString = OutString & "|" & space(25) & "|" & vbcrlf
OutString = Outstring & String(27,"-")
This example works if you use a font like courier new.
Hope this helps
-
no no no. I was trying to draw a page. I want to put certain things onplaces in the page. forget the |'s i just want to know how ot tell poages how to put a word at 2 inches down 3 accross. for example. thansk.
-
Re: Spaces!!!!
Quote:
Originally posted by Negative0
Try this
Code:
OutString = String(27,"-")& vbCrLf
OutString = OutString & "|" & space(25) & "|" & vbcrlf
OutString = OutString & "|" & text1.text & space(25-len(text1.text)) & "|" & vbcrlf
OutString = OutString & "|" & space(25) & "|" & vbcrlf
OutString = OutString & "|" & text2.text & space(25-len(text2.text)) & "|" & vbcrlf
OutString = OutString & "|" & space(25) & "|" & vbcrlf
OutString = Outstring & String(27,"-")
This example works if you use a font like courier new.
Hope this helps
Negative0 is correct. If you use the space function, you can put things in a certain place. Or if you use a textbox, use Chr$(9) for spacing. That is, if that is what you are trying to do.
-
i am basically trying to fill in a form on paper by filling htings in a progrma, like the program asks for your name and it prints on the form where the name needs to go. the way your suggesting is mostly guess nad check is there another way?
-
Printing
Doing what you're trying to do is pretty easy once you get a feel for the printer object in VB.
1. Get comfortable with Twips, the units of measurement on a printed page.
2. Review GetDeviceCaps API so that you can find the unprintable area of the printer you're using
3. Read about the Printer.CurrentX and Printer.CurrentY methods to set the location of the printers next line
4. Use the Printer.Print method to print the text.
This should get you started. Email me if you need more help.
John