How to Customize Printing (i.e to print postscript over text)

A

Ahmad Jalil Qarshi

hi!

I want to automate printing using VBA. My requirements are as under:

1. Select "Print postscript over text" and "Print to file" checkboxes.
2. Select a printer from a list of printers for printing.

I also want to provide the file where the postscript will be printed by
default. i.e. I dont want Word to ask me where do you want to print you
postscript.

if someone knows about that plz help me.

Thanks,

Ahmad Jalil Qarshi
 
J

Jonathan West

Ahmad Jalil Qarshi said:
hi!

I want to automate printing using VBA. My requirements are as under:

1. Select "Print postscript over text" and "Print to file" checkboxes.
2. Select a printer from a list of printers for printing.

I also want to provide the file where the postscript will be printed by
default. i.e. I dont want Word to ask me where do you want to print you
postscript.

if someone knows about that plz help me.

Thanks,

Ahmad Jalil Qarshi

Hi Ahmad

This article tells you how to get the list of available printers

Getting names of available printers
http://www.word.mvps.org/FAQs/MacrosVBA/AvailablePrinters.htm


This article tells you how to set a particular printer for printing from
Word

Changing the selected (current) printer in Word without changing the system
default printer
http://www.word.mvps.org/FAQs/MacrosVBA/ChangeCurPrinter.htm


You can set printing Postrcript over text by setting the
PrintPostScriptOverText property of the document to True

To print to a specified file, in the Printout method set the PrintToFile
parameter to True, and the OutputFileName to the full pathname of the file
you want to create.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
A

Ahmad Jalil Qarshi

Thanks Jonathan. You solved my Problems.
But there is a problem with me. I am using VC++7. I did all the things in
VC++7 successfully. But i couldn't do following in VC++7.
With Dialogs(wdDialogFilePrintSetup)
.Printer = "HP DeskJet 670C Series v11.0 on LPT2:"
.DoNotSetAsSysDefault = True
.Execute
End With

i.e I want to print on one of the printers installed on my machine but I
don't want to change the default printer. The above code satisfy my this
requirement. but I couldn't do that in VC7. If someone knows about that, Plz
help me.
Thanks
Ahmad Jalil Qarshi
 
J

Jonathan West

Ahmad Jalil Qarshi said:
Thanks Jonathan. You solved my Problems.
But there is a problem with me. I am using VC++7. I did all the things in
VC++7 successfully. But i couldn't do following in VC++7.
With Dialogs(wdDialogFilePrintSetup)
.Printer = "HP DeskJet 670C Series v11.0 on LPT2:"
.DoNotSetAsSysDefault = True
.Execute
End With

i.e I want to print on one of the printers installed on my machine but I
don't want to change the default printer. The above code satisfy my this
requirement. but I couldn't do that in VC7. If someone knows about that,
Plz
help me.

Hi Ahmad

OK, I don't know how to do that using VC++ either.

There is an alternative approach. Before you print, read the value of the
ActivePrinter property of the Word Application object.

Then change to the new printer, by setting ActivePrinter to a new value

Then do your printing.

Then restore the ActivePrinter to the original value you saved at the start.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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