Results 1 to 7 of 7

Thread: printing in VB

  1. #1
    Guest
    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

  2. #2
    Guest
    i guess yall will have to ignore my attempt at an exapmle.

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Cool 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

  4. #4
    Guest
    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.

  5. #5
    Guest

    Re: Spaces!!!!

    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.

  6. #6
    Guest
    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?

  7. #7
    Guest

    Talking 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width