Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Sierra Madre, California, USA
    Thanked 0 Times in 0 Posts

    Printer to IP Address Printer ( Word - any)

    I wrote a macro that sets up some page settings and then prints to a particular bin of a particular printer. The problem is that the printer is no longer on the server - it's at an IP address.
    The properties of the printer now say IP_xxx.xx.xx.xx The name of the printer is the same, but it won't print - even when I take out the reference to the server. Is there a special way to code for an IP address?
    This is what I used when the printer was on the server:
    <pre>Dim strDefaultPrinter As String 'used to capture default printer
    Const strPrinter_1 As String = "FREDHP LaserJet 4050 Series on NE03:"

    Const strBin_1 As String = 256 'Letterhead
    Const strBin_2 As String = 258 'white bond

    Sub prnt_1()
    On Error GoTo errHandler
    strDefaultPrinter = Application.ActivePrinter 'capture active printer
    ActivePrinter = strPrinter_1 'change to appropriate printer
    With ActiveDocument.PageSetup 'change to appropriate bins
    .FirstPageTray = strBin_1
    .OtherPagesTray = strBin_2
    End With
    ActiveDocument.PrintOut 'prints document
    ActivePrinter = strDefaultPrinter 'reset to active printer

    'Call ExitProc
    Exit Sub

    MsgBox "Message." & Err.Number & Err.Description, vbExclamation, "Error Message"
    Exit Sub

    End Sub text</pre>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Printer to IP Address Printer ( Word - any)

    You can try recording a macro an switch to another printer, then back to the printer in question. The recorded code should give you an idea of how to refer to the printer.

Posting Permissions

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