Results 1 to 2 of 2

Thread: problems printing

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2000
    Posts
    16
    i have a big text box, when i try to print the contents of the text box two things happen

    1. it wont print until i exit the program. when i open the print dialog box it says spooling under stauts but as soon as i exit my program it starts printing.

    2. i hav tab char's in my text box, they display correct in the text box, but i print all i get is one blank space.
    i make up my string and add chr(9) to the string for my tabs. should i use a diffrent char code?

    my code for printing is

    Sub Command4_Click()
    Printer.Print Text1.Text
    End Sub
    any help would be great, thanx

    [Edited by Iceman10 on 05-01-2000 at 05:27 PM]
    VB Ver 6.0

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Lightbulb

    1. You need to use EndDoc method to print, i.e
    Code:
    Printer.Print "This is a test"
    Printer.EndDoc
    2. You can substitute tabs with spaces:
    Code:
    Dim strText
    
    strText = Replace(Text1.Text, Chr(9), "    ")
    Printer.Print
    Printer.EndDoc

    Note: must have VB6 installed in order to use Replace function. If you have earlier version then you would have to parse the string manually to change the it.

    [Edited by Serge on 05-01-2000 at 08:25 PM]

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