Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ahmad Jalil Qarshi - 24 Mar 2005 11:29 GMT
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
Jonathan West - 24 Mar 2005 23:31 GMT
> hi!
>
[quoted text clipped - 12 lines]
>
> 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.

Signature

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 

Ahmad Jalil Qarshi - 25 Mar 2005 12:32 GMT
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

> > hi!
> >
[quoted text clipped - 40 lines]
> Please reply to the newsgroup
> Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jonathan West - 25 Mar 2005 14:26 GMT
> Thanks Jonathan. You solved my Problems.
> But there is a problem with me. I am using VC++7. I did all the things in
[quoted text clipped - 10 lines]
> 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.

Signature

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 

Ahmad Jalil Qarshi - 25 Mar 2005 16:36 GMT
Thanks Jonathan you r really great!

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
[quoted text clipped - 30 lines]
> Please reply to the newsgroup
> Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.