Results 1 to 6 of 6

Thread: Print PostScript file to LPT1

  1. #1

    Thread Starter
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342

    Print PostScript file to LPT1

    Something I haven't done, need some help...

    I have a .ps file I need to send directly to LPT1

    how do I do this in VB6 ?
    Talk does not cook rice.
    -Chinese Proverb

  2. #2
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Print PostScript file to LPT1

    I think this should do it:

    VB Code:
    1. Shell "copy whatever.ps lpt1"
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

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

    Re: Print PostScript file to LPT1

    VB Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    2. (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    3. ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    4.  
    5. Private Sub Command1_Click()
    6. Dim lngPrintIt As Long
    7. lngPrintIt = ShellExecute(Me.hwnd, "PRINT", "C:\My Documents\Whatever.ps", "", "", -1)
    8. End Sub

  4. #4

    Thread Starter
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342

    Re: Print PostScript file to LPT1

    Thanks to both of you!
    Talk does not cook rice.
    -Chinese Proverb

  5. #5

    Thread Starter
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342

    Re: Print PostScript file to LPT1

    Oops.....thanks too soon....or I am doing something all wrong...

    I tried:
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim lngPrintIt As Long
    3.     lngPrintIt = ShellExecute Me.hwnd, "PRINT", "C:\MyPrograms\PrintOrders\Orders1.ps", "", "", -1)
    4. End Sub

    (with the Shell Execute Function copied and pasted)

    and it doesnt seem to be working......

    am I missing something...this is the only coding behind the button
    help?
    Talk does not cook rice.
    -Chinese Proverb

  6. #6
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Print PostScript file to LPT1

    Try:
    Shell "copy C:\MyPrograms\PrintOrders\Orders1.ps lpt1"
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

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