Results 1 to 3 of 3

Thread: Printing each line of typing with vb code

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Location
    Bangladesh
    Posts
    2

    Cool

    How can I use Printer as typewriter with VB code or I want to print each line I type before going to next line.
    Md. Shahidul Islam
    Bangladesh

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'this will print after each line but remember
    'each line will now use 1 page of paper.
    '
    'a pc is not a typewriter
    '
    Option Explicit
    
    Public sMyTyping As String
    
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        
        sMyTyping = Text1.Text & Chr(KeyAscii)
    
    'when I press enter that is the end of the line
        If KeyAscii = 13 Then
            Printer.Print sMyTyping
            Printer.EndDoc
            sMyTyping = ""
        End If
            
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    You could try opening the printer on LPT1 as a file and writing directly to it.

    This works fine on tractor feed printers.
    Mark
    -------------------

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