Results 1 to 3 of 3

Thread: Hellp please with printers

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316

    Post

    I have an application that has to print to 2 printers. They are serial printers and I have this working fine useing MSCOMM

    The problem is that more than one PC has to print to the printer.

    I want to print the stuff using the windows printer drivers but how would I do this.

    I have all the stuff on strings and just want to throw these to the printer.

    Help please

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Location
    Oporto, Portugal
    Posts
    134

    Post

    Are the printers shared ? If yes you can access them by choosing them in a printer dialog box or even directly (by code). If they are not shared I don't know if there is a way to communicate with a remote serial port.

    ------------------
    Jorge Ledo
    j_ledo@hotmail.com
    Portugal

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Once you've add the Printers to the Printers Folder in Windows, you can Access them from VB via the Printer Object, ie.
    Code:
    Function SetPrinter(ByVal PrinterName As String) As String
        Dim oPRN As Printer
        For Each oPRN In Printers
            If LCase(oPRN.DeviceName) = LCase(PrinterName) Then
                SetPrinter = Printer.DeviceName
                Set Printer = oPRN
                Exit For
            End If
        Next
    End Function
    Use this Function to Set the Printer Object to a Specific Printer, by passing the Name of the Printer, ie.

    sOldPrinter = SetPrinter("Generic/Text Only")

    The Name of the Current Printer is Returned, so that if need be you can easily restore it by Calling the Function again.

    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    ajyoung@pressenter.com


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