need help in printing

  • Thread starter Thread starter jabslim via DotNetMonster.com
  • Start date Start date
J

jabslim via DotNetMonster.com

i want to print files in vb.net with the ability to let users choose if they
want it "colored" or only "black and white"(grayscale). how can i make a file
print in only "black and white"?

ill illustrate an example to explain my question better:
a user opens a word file(.doc) and the file has colored text and images, then
the user has 2 options, to print in colored or black, so if they choose:
a.) colored - it will only print normally
b.) black - it needs to alter the settings of the printer to make it
grayscale, so even if the file has colored text and images, it will only be
printed in black and white.

so my question is, how do i do letter b? can someone post a code to do this?

thanks!!
 
jabslim via DotNetMonster.com said:
i want to print files in vb.net with the ability to let users choose if
they
want it "colored" or only "black and white"(grayscale). how can i make a
file
print in only "black and white"?

ill illustrate an example to explain my question better:
a user opens a word file(.doc) and the file has colored text and images,
then
the user has 2 options, to print in colored or black, so if they choose:
a.) colored - it will only print normally
b.) black - it needs to alter the settings of the printer to make it
grayscale, so even if the file has colored text and images, it will only
be
printed in black and white.

If you are using the Word object model, try this:

\\\
With ActiveDocument
.Compatibility(wdPrintColBlack) = True
Call .PrintOut
.Compatibility(wdPrintColBlack) = False
End With
///
 
i use dsoframer control to open the .doc files... and i use this code below
to print normally:


Dim print_file As New ProcessStartInfo
print_file.UseShellExecute = True
print_file.Verb = "print"
print_file.WindowStyle = ProcessWindowStyle.Hidden
print_file.FileName = file_doc '----file_doc is the one the user
opened (openfiledialog1.filename)
Process.Start(print_file)


i didnt quite get the code you posted. im sorry because im just a little new
here in vb.net and i still dont know all the things about it.

how do you add the codes to make it print in grayscale? thanks!



jabslim via DotNetMonster.com said:
i want to print files in vb.net with the ability to let users choose if
they
[quoted text clipped - 11 lines]
be
printed in black and white.

If you are using the Word object model, try this:

\\\
With ActiveDocument
.Compatibility(wdPrintColBlack) = True
Call .PrintOut
.Compatibility(wdPrintColBlack) = False
End With
///
 
jabslim via DotNetMonster.com said:
i use dsoframer control to open the .doc files... and i use this code below
to print normally:

Dim print_file As New ProcessStartInfo
print_file.UseShellExecute = True
print_file.Verb = "print"
print_file.WindowStyle = ProcessWindowStyle.Hidden
print_file.FileName = file_doc '----file_doc is the one the user
opened (openfiledialog1.filename)
Process.Start(print_file)

i didnt quite get the code you posted. im sorry because im just a little
new
here in vb.net and i still dont know all the things about it.

how do you add the codes to make it print in grayscale? thanks!

You cannot use the code I posted together with the code above. You'd have
to follow the guidelines in the "Automating Using Managed Code" section of
this article:

<URL:http://msdn2.microsoft.com/en-us/library/76d2d007.aspx>

Note that this will only work if Word is installed on the target machine.
 
oh... may i know how to use your code above to print a file in grayscale?
can you provide a sample code? thanks!


jabslim via DotNetMonster.com said:
i use dsoframer control to open the .doc files... and i use this code below
to print normally:
[quoted text clipped - 12 lines]
how do you add the codes to make it print in grayscale? thanks!

You cannot use the code I posted together with the code above. You'd have
to follow the guidelines in the "Automating Using Managed Code" section of
this article:

<URL:http://msdn2.microsoft.com/en-us/library/76d2d007.aspx>

Note that this will only work if Word is installed on the target machine.
 
can someone please help me with how to print files in grayscale or black and
white mode?
bacause i still haven't figured out how to do it and i really need it for my
project.
can anyone please post a code on how to print in grayscale? will really
appreciate it very much! thanks!
 
Back
Top