Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Code not printing to color printer

Alright, I have another one. I have a code that prints out sheets for me in a
certain order. I have the code open up a word document and then prints that
document. However, it will not print to the color printer, it only prints to
my default printer. How can I make the code have the word doc print to my
color printer. Here is my current code. Any help is appreciated. Thanks.

On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Application.ScreenUpdating = False
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005
t&cscontract.doc")
WD.ActiveDocument.PrintOut Background:=False
WD.Application.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Code not printing to color printer

I forgot to mention. The excel sheets are printing just fine in color to my
"HP C LaserJet 4550N PCL6", it's only the word document that won't print to
this printer.

"Brad" wrote:

Alright, I have another one. I have a code that prints out sheets for me in a
certain order. I have the code open up a word document and then prints that
document. However, it will not print to the color printer, it only prints to
my default printer. How can I make the code have the word doc print to my
color printer. Here is my current code. Any help is appreciated. Thanks.

On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Application.ScreenUpdating = False
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005
t&cscontract.doc")
WD.ActiveDocument.PrintOut Background:=False
WD.Application.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default Code not printing to color printer

You are setting Active Printer for Excel Application.
Set it for Word Application too:- i.e. WD.ActivePrinter
"Brad" wrote in message
...
I forgot to mention. The excel sheets are printing just fine in color to my
"HP C LaserJet 4550N PCL6", it's only the word document that won't print
to
this printer.

"Brad" wrote:

Alright, I have another one. I have a code that prints out sheets for me
in a
certain order. I have the code open up a word document and then prints
that
document. However, it will not print to the color printer, it only prints
to
my default printer. How can I make the code have the word doc print to my
color printer. Here is my current code. Any help is appreciated. Thanks.

On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Application.ScreenUpdating = False
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005
t&cscontract.doc")
WD.ActiveDocument.PrintOut Background:=False
WD.Application.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default Code not printing to color printer

Before WD.ActiveDocument.PrintOut,

Add line

WD.ActivePrinter = "Name of the active printer on "printer port identifier"
"

Sharad
"Brad" wrote in message
...
Alright, I have another one. I have a code that prints out sheets for me
in a
certain order. I have the code open up a word document and then prints
that
document. However, it will not print to the color printer, it only prints
to
my default printer. How can I make the code have the word doc print to my
color printer. Here is my current code. Any help is appreciated. Thanks.

On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Application.ScreenUpdating = False
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005
t&cscontract.doc")
WD.ActiveDocument.PrintOut Background:=False
WD.Application.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Code not printing to color printer

You also may be able to

WD.ActivePrinter = Application.ActivePrinter

since you've already set it for Excel.

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

Sharad Naik wrote:
Before WD.ActiveDocument.PrintOut,

Add line

WD.ActivePrinter = "Name of the active printer on "printer port
identifier" "

Sharad
"Brad" wrote in message
...
Alright, I have another one. I have a code that prints out sheets
for me in a
certain order. I have the code open up a word document and then
prints that
document. However, it will not print to the color printer, it only
prints to
my default printer. How can I make the code have the word doc print
to my color printer. Here is my current code. Any help is
appreciated. Thanks. On Error Resume Next
Application.ActivePrinter = "HP C LaserJet 4550N PCL6 on Ne01:"
If Err.Number = 1004 Then
Application.ActivePrinter = "hp c Laserjet 4550N PCL6 on Ne02:"
Err.Clear
End If
Application.ScreenUpdating = False
Sheets("Letter").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open ("G:\CONTRACT\Contract Terms\macro\2005
t&cscontract.doc")
WD.ActiveDocument.PrintOut Background:=False
WD.Application.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Cover").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Agreement").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem printing to HP color printer toodi4 Excel Worksheet Functions 0 January 12th 09 07:36 PM
Printing labels on a dot matrix printer - what does this code do Laurence Lombard Excel Discussion (Misc queries) 2 June 19th 06 06:15 AM
Printing labels on a dot matrix printer - what does this code do Laurence Lombard Excel Discussion (Misc queries) 0 June 16th 06 07:18 AM
Printing Excel Spreadsheet to Color Printer Karen Excel Discussion (Misc queries) 2 April 19th 06 07:29 PM
Printing To A Specified Printer Steven Pearl Excel Programming 6 January 6th 04 09:14 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"