Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Want to print to an IP address (2003)

    I am wanting to know if there is a way to print to a specific printer using the printers IP address, using VBA?
    thanks
    jacakl

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Want to print to an IP address (2003)

    Why does it have to be the IP address? Is there issue with using the Printer's name?

    Application.ActivePrinter
    can be used to set or get the activeprinter name

    Steve

  3. #3
    2 Star Lounger
    Join Date
    Jan 2004
    Posts
    196
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Want to print to an IP address (2003)

    When I use:
    Application.ActivePrinter = "Pe4300HP Color InkJet CP1700 on Ne05"
    This works today, but when I redock my laptop the Ne?? is different, so i was hoping i could just print to the IP address, which is always the same.
    In my spreadsheet, there are approx 30 graphs that i am printing. If there is a way to select the printer, then print all the graphs with that printer that would work.
    thanks,
    jackal

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Want to print to an IP address (2003)

    What about something like this?

    Steve

    <pre>Option Explicit
    Sub setPrinter()
    Dim sPrinter As String
    Dim x As Integer
    sPrinter = "Pe4300HP Color InkJet CP1700"

    For x = 0 To 9
    On Error Resume Next
    Application.ActivePrinter = sPrinter & " on Ne0" & x & ":"
    On Error GoTo 0
    Next
    MsgBox "Active Printer is:" & vbCrLf & _
    Application.ActivePrinter
    End Sub</pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •