Recorded macros to printout a document in colour, doesn't work!

F

FIP

Hello

I have recorded a Macro in order to print out a colour document. I have
entered colour print in the options, but it still prints out in black and
white!?!

Can someone please help me and also dvise why this is and what I am doing
wrong??

I use WORD 2003 / MS Visual Basic 6.0

Sub MACRO_GIF()
'
' MACRO_GIF Makro

ActivePrinter = "\\htprint1\HC01"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

Application.Quit SaveChanges:=wdDoNotSaveChanges

End Sub

Dear Regards
Emanuel
 
R

Russ

Do you see your text and/or graphics in colour in Page View? If you go into
printpreview view in Word, do you see your text and/or graphics in colour?
Nothing in the code you showed deals with colour. You have to set your
printer preferences to print in color.
 
F

FIP

Hi Russ,

Thanks for your quick reply!

In answer to your two questions; yes, yes! I set colour in all the options
and preferences, then go to print in colour, but the code itself does not
reflect this - as you correctly point out, no mention of colour in the code!

Where could the problem lie? Are there any additional commands to print in
colour which may have been missed?

How can I make VB print out in colour, using a Macro?

Look forward to your reply.
Regards
Emanuel
 
J

Jonathan West

FIP said:
Hello

I have recorded a Macro in order to print out a colour document. I have
entered colour print in the options, but it still prints out in black and
white!?!

Can someone please help me and also dvise why this is and what I am doing
wrong??

You're not doing anything wrong, it is just that changes in printer settings
don't get recorded. If you want to use VBA to control the colour settings on
the printer, it is not a trivial task, especially if you are at the stage of
recording rather than writing macros. But if you want to give it a go, take
a look at these articles

Controlling the Printer from Word VBA
Part 1: Using VBA to Select the Paper Tray
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=101

Controlling the Printer from Word VBA
Part 2: Using VBA to control Duplex, Color Mode and Print Quality
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116
 
F

FIP

Dear Jonathan,

Thank you for the two links.

The second link, unfortunately, does not work for Word 2003 (VB 6.0) this
link is valid for the older version, therefore a symtax error always appears.

Do you have another link which is valid for the VB 6.0? I would very much
appreciate it if you could send me information for this version!

All rather frustrating :))

Regards
Emanuel
 
R

Russ

Emanuel,
Can anybody else print out in colour on the the printer, because it could be
the local settings of the printer, itself, are not set up to print in
colour? That is what I meant in my last reply the preferences in the
printer, itself, must be set up to print in colour.
 
R

Russ

Emanuel,
If the printer is on a network, you may not have global permissions to
change the printer settings. See "More Information" at this original link.
<http://support.microsoft.com/kb/230743>
What kind of syntax error do you get? At which line? Sometimes it is a
simple copy and paste error, because of lines breaking into two, that should
not.
 
B

Beeawwb

Hi Emanuel,

I've been using Jonathan's code (both links 1 and 2) for a few months now in
Word 2003, and they both work fine. I've just tried the "printing in color"
one, and I don't get any syntax errors (apart from being unable to access the
settings on my color printer, but that's my printer; not the code) when
running it. Have you copied all the "reference" modules at the end of article
2, which are required for the code to work?

And to Jonathan, thanks for such a well written article. Those 2 have really
helped me understand how Word interacts with the printer, it's really been a
huge resource.

Emanuel, I hope you're able to solve this quickly. :)

-Bob
 
F

FIP

Dear Bob,
Dear Jonathan,

Thank you both for your support and quick replies! The problem is now
solved, should have come upon the answer myself - always easy in hindsight!

However, one problem does remain to be answered...
When entering method OpenPrinter, then iRet = 0

pd.DesiredAccess = PRINTER_NORMAL_ACCESS
iRet = OpenPrinter(sPrinterName, hPrinter, pd)
If (iRet = 0) Or (hPrinter = 0) Then
'Can't access current printer. Bail out doing nothing
Exit Function
End If

Where am I going wrong? Any suggestions?

Many thanks for your continued help...
Regards
Emanuel
 
R

Russ

Emanuel,
Does sPrinterName contain the name of the active printer?

Use:
msgbox sPrinterName
just before OpenPrinter() function.

Does your security policy grant you permission to change printer settings
over a network?
 
F

FIP

Dear Russ,
Dear Jonathan,
Dear Bob,

Problem has been solved - I didn't have the necessary permission for the
colour printer.........!

Once again, many thanks to all who have helped and a special note to
Jonathan "great links, very user friendly and helpful"

Wishing you a nice weekend
Emanuel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top