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
> 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