Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Test Printer for Colour/BW

Greetings all

I have a number of programatically created reports that are tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print in
BW

How can I test for whether the default printer is colour or BW from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Test Printer for Colour/BW

Kieran,
What changes do you intend to make if the printer is B/W ?

NickHK

"Kieran H"
egroups.com...
Greetings all

I have a number of programatically created reports that are tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print in
BW

How can I test for whether the default printer is colour or BW from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Test Printer for Colour/BW

Nick,

Thanks for replying - my master plan was to write a function that would
return a boolean (FALSE) if the users default printer was colour.

Then set the ActiveSheet.PageSetup.BlackAndWhite property to the return
value

Perhaps not world domination but its a start! :)

Kieran H


NickHK wrote:
Kieran,
What changes do you intend to make if the printer is B/W ?

NickHK

"Kieran H"
egroups.com...
Greetings all

I have a number of programatically created reports that are tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print in
BW

How can I test for whether the default printer is colour or BW from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Test Printer for Colour/BW

Kieran,
It certainly should be possible to determine if a printer is BW only from
one of the Printer_Info types.
Just wondering if it is worth it. If you send a colour print job to a BW
printer, doesn't the driver sort out the closest greyscale match ? Not sure
of quality of output.
Does this output (as above) differ much from setting BlackAndWhite to True
and then printing ?

NickHK

"Kieran H" wrote in message
oups.com...
Nick,

Thanks for replying - my master plan was to write a function that would
return a boolean (FALSE) if the users default printer was colour.

Then set the ActiveSheet.PageSetup.BlackAndWhite property to the return
value

Perhaps not world domination but its a start! :)

Kieran H


NickHK wrote:
Kieran,
What changes do you intend to make if the printer is B/W ?

NickHK

"Kieran H"
egroups.com...
Greetings all

I have a number of programatically created reports that are tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print in
BW

How can I test for whether the default printer is colour or BW from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Test Printer for Colour/BW

Kieran,
Looks like you will need the OpenPprinter, GetPrinter, ClosePrinter APIs
with the PRINTER_INFO_2 and DEVMODE types, reading the value of dmColor
(http://msdn.microsoft.com/library/en...sp?frame=true).

This http://vb.mvps.org/samples/project.asp?id=PrnInfo gives the basics of
the required code.

But first decide if it is worth it.

NickHK

"NickHK" wrote in message
...
Kieran,
It certainly should be possible to determine if a printer is BW only from
one of the Printer_Info types.
Just wondering if it is worth it. If you send a colour print job to a BW
printer, doesn't the driver sort out the closest greyscale match ? Not

sure
of quality of output.
Does this output (as above) differ much from setting BlackAndWhite to True
and then printing ?

NickHK

"Kieran H" wrote in message
oups.com...
Nick,

Thanks for replying - my master plan was to write a function that would
return a boolean (FALSE) if the users default printer was colour.

Then set the ActiveSheet.PageSetup.BlackAndWhite property to the return
value

Perhaps not world domination but its a start! :)

Kieran H


NickHK wrote:
Kieran,
What changes do you intend to make if the printer is B/W ?

NickHK

"Kieran H"
egroups.com...
Greetings all

I have a number of programatically created reports that are

tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print

in
BW

How can I test for whether the default printer is colour or BW

from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Test Printer for Colour/BW

Kieran,
OK, I have a class that will determine the colour mode. Let me know if you
want it.
However, I'm not sure if it returns the correct answer for an old dot matrix
printer that I have, all others (copier, fax, PDF, HP colour, HP black etc)
it returns the correct result.

NickHK

"Kieran H" wrote in message
oups.com...
Nick,

Thanks for replying - my master plan was to write a function that would
return a boolean (FALSE) if the users default printer was colour.

Then set the ActiveSheet.PageSetup.BlackAndWhite property to the return
value

Perhaps not world domination but its a start! :)

Kieran H


NickHK wrote:
Kieran,
What changes do you intend to make if the printer is B/W ?

NickHK

"Kieran H"
egroups.com...
Greetings all

I have a number of programatically created reports that are tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print in
BW

How can I test for whether the default printer is colour or BW from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Test Printer for Colour/BW

Nick,

Many thanks for your research, the class you described sounds exactly
what I need.

As for whether its worth it ?- It looks good on screen or printed in
colour but looks crap if printed in bw (the grey is too dark)

Poor code that still works may be criticised by my peers but with poor
presentation eveyone's a critic!

Thanks again

Kieran

NickHK wrote:
Kieran,
OK, I have a class that will determine the colour mode. Let me know if you
want it.
However, I'm not sure if it returns the correct answer for an old dot matrix
printer that I have, all others (copier, fax, PDF, HP colour, HP black etc)
it returns the correct result.

NickHK

"Kieran H" wrote in message
oups.com...
Nick,

Thanks for replying - my master plan was to write a function that would
return a boolean (FALSE) if the users default printer was colour.

Then set the ActiveSheet.PageSetup.BlackAndWhite property to the return
value

Perhaps not world domination but its a start! :)

Kieran H


NickHK wrote:
Kieran,
What changes do you intend to make if the printer is B/W ?

NickHK

"Kieran H"
egroups.com...
Greetings all

I have a number of programatically created reports that are tastefully
coloured (I hope!)

I am very happy for them to print on colour if the users default
printer is colour.

However if they have a BW printer I would like the report to print in
BW

How can I test for whether the default printer is colour or BW from
within Excel.

I'm guessing it will require an API call

Your thoughts would be appreciated

Cheers

Kieran H



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
How can I test for colour format in if statements? Colin Excel Worksheet Functions 1 April 6th 09 10:56 AM
members on my network printer not able to print to default printer smeheut Excel Discussion (Misc queries) 0 June 18th 07 06:42 PM
Test printer parameter before continuing with macro Chris Salcedo Excel Programming 1 July 30th 06 07:21 AM
Send printer escape commands to a printer using VBA mikeburg[_41_] Excel Programming 3 October 6th 05 07:36 PM
Can I fill colour in a excel cell from a return from an "IF" test. williamw Excel Worksheet Functions 1 March 24th 05 10:31 AM


All times are GMT +1. The time now is 11:10 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"