Results 1 to 2 of 2

Print a Word doc to dynamic printer name

Threaded View

  1. #1
    Registered User
    Join Date
    06-02-2009
    Location
    Arlington, VA
    MS-Off Ver
    Excel 2007
    Posts
    80

    Print a Word doc to dynamic printer name

    I am using the below code to print to specific printers. I cannot rely on the user's default printer, becuase that printer is often not in color(which the doc requires). The code works for Excel worksheets, but now for the specified word doc. What do I need to change to get this to print to the specified printer?

    Sub printtest()
    
    
    Dim objWord As Word.Application
    Dim doc As Word.Document
    
    Set objWord = New Word.Application
    
    Set doc = objWord.Documents.Open(Filename:="S:\STATEMENT.DOCX", Visible:=True)
        Dim sCurrentPrinter As String
    
        sCurrentPrinter = ActivePrinter
        ActivePrinter = "Xerox Phaser 8560DT PS3 RSN14_XX8560P" & Sheets("inputs").Range("b8") & " on Ne" & Sheets("inputs").Range("g41") & ":"
    doc.PrintOut Copies:=1, Collate:=True
    
    doc.Close False
    objWord.Quit
    
    Set doc = Nothing
    Set objWord = Nothing
    
    End Sub
    Last edited by nsorden; 07-09-2009 at 09:44 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1