Results 1 to 5 of 5

Thread: [RESOLVED] Communicate with printer through COM port

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    34

    Resolved [RESOLVED] Communicate with printer through COM port

    I've started doing a small program which required to print out on Olivetti PR2e Passbook Printer (text only, the printer is connected to computer by COM1 port without any driver installed)
    Please help
    Best regard

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Communicate with printer through COM port

    You have posted the same question in ClassicVb.

    Are you doing this through a VB program or through VBA?

    Assitance you get from this section will be VBA specific which might not work with VB; conversely any assistance you get in ClassicVb with be VB specific and might not work in VBA.

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    34

    Re: Communicate with printer through COM port

    I'm doing this with both VB and VBA, in fact I'm making an MS.Access program which require to print out text on a printed form. Thank you for your direction and inttention

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Communicate with printer through COM port

    You need a manual to the printer to get the escape codes. Are you writing a driver or was that someone else? I saw a few links to this forum as well.

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2005
    Posts
    34

    Re: Communicate with printer through COM port

    I've got the manual, but i didn't know what must I do at first. Some escape code work properly but I can't print out the text. My VB code is as follow:
    Visual Basic 6.0
    PrnPort.CommPort = 1
    PrnPort.Settings = "9600,n,8,1"
    PrnPort.ParityReplace = "?"
    PrnPort.Handshaking = comRTSXOnXOff
    PrnPort.PortOpen = True
    PrnPort.RThreshold = 1
    PrnPort.SThreshold = 1
    PrnPort.DTREnable = True
    PrnPort.RTSEnable = True
    PrnPort.Output=”Hello” & Chr$(13) & chr$(10) ‘Print out the text - perform no action
    PrnPort.Output=Chr$(&H1B) & Chr$(&H4F)) ‘Esc O Eject paper - working properly
    Please help
    Best regard

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