Let me cut & paste some code I have:
First, lets say you have a printer who's IP address is {string}:
"192.168.33.99"

And then, lets say you have a Queue on your printer, like:

"XRX_Swop"

Then this is the code I would use:

VB Code:
  1. 'In a sub somewhere:
  2.  
  3. MyLPStr = "lpr -S " & "192.168.33.99" & " -P " & "XRX_Swop" & " "
  4. SyncShellCmd MyLPStr & "-J" & Chr$(34) & "p003456-save" & Chr$(34) & " " & Chr$(34) & "C:\p003456-duplex-save.pdf" & Chr$(34), 0
  5.  
  6.  
  7. 'Then, you have the function SyncShellCmd somewhere in your
  8. 'forms code:
  9.  
  10. Public Function SyncShellCmd(CmdStr As String, ByVal ApplicationFocus As Long) As Boolean
  11. 'Run the application by the CmdStr, and exit when the program terminated, Application focus specific
  12. 'the focus of the application. e.g vbNormalFocus
  13. Dim lPid As Long 'The task ID of the started program
  14. Dim lHnd As Long ' handle to object to wait for
  15. Dim lRet As Long 'Return value of WaitForSingleObject()
  16.  
  17. SyncShellCmd = False
  18. If CmdStr = "" Then Exit Function
  19. lPid = Shell(CmdStr, ApplicationFocus)
  20.     If lPid <> 0 Then
  21.     'Get a handle to the shelled process.
  22.     lHnd = OpenProcess(&H100000, 0, lPid)
  23.     'If successful, wait for the application to end and close the handle.
  24.         If lHnd <> 0 Then
  25.             lRet = WaitForSingleObject(lHnd, &HFFFF) 'no time out
  26.             CloseHandle (lHnd)
  27.             SyncShellCmd = True
  28.         End If
  29.        
  30.     End If
  31.  
  32. End Function
  33. 'Either put these three in a Bas, declared as public,
  34. 'or at the top of your forms code module:
  35.  
  36. Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
  37. Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
  38. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

-Hope this helps
-Lou

BTW, the point of all this is you are essentially shelling to the LPR.exe, if you happen to have it on your system.