Discussion:
Change printer delphi x word
(too old to reply)
Marcelo
2004-12-03 15:42:12 UTC
Permalink
I need to let the user change the printer in my application delphi x word,
but only for that one document, and doesn't want to change the default
printer each time.


wordapp.activateprinter - property change the default printer

Marcelo
Deborah Pate (TeamB)
2004-12-03 16:26:18 UTC
Permalink
<<Marcelo:
I need to let the user change the printer in my application
delphi x word, but only for that one document, and doesn't
want to change the default printer each time.
For this you have to use the old WordBasic commands:

var
Basic: olevariant;
...
Basic := WordApp.WordBasic;
Basic.FilePrintSetup(
Printer := 'Canon BubbleJet 200e on LPT1',
DoNotSetAsSysDefault := 1);
--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
Jon Robertson
2004-12-03 15:31:48 UTC
Permalink
Post by Deborah Pate (TeamB)
var
Basic: olevariant;
...
Basic := WordApp.WordBasic;
Basic.FilePrintSetup(
Printer := 'Canon BubbleJet 200e on LPT1',
DoNotSetAsSysDefault := 1);
If I do this, will WordApp.PrintOut use the printer specified above?

If so, that's *FANTASTIC!* We currently save the default printer, call
WordApp.PrintOut, then set the default printer back. I knew there had
to be a better way! :)
--
Jon Robertson
Borland Certified Advanced Delphi 7 Developer
MedEvolve, Inc
http://www.medevolve.com
Deborah Pate (TeamB)
2004-12-03 17:24:17 UTC
Permalink
<<Jon Robertson:
If I do this, will WordApp.PrintOut use the printer
specified above?
I believe so - but as I've never owned more than one
printer at a time, you might want to check. :)
--
Deborah Pate (TeamB) http://delphi-jedi.org

TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
Jon Robertson
2004-12-03 20:40:32 UTC
Permalink
Post by Jon Robertson
If I do this, will WordApp.PrintOut use the printer
specified above?
I believe so - but as I've never owned more than one
printer at a time, you might want to check. :)
Deborah Pate (TeamB) http://delphi-jedi.org
If you want to test you can just install another printer driver.
It shouldn't matter if the printer is there or not.
I have it on my to-do list to test this. Unfortunately, I can't at the
moment. But I have a good environment for testing already once I get
to it.

I'll post the results then.
--
Jon Robertson
Borland Certified Advanced Delphi 7 Developer
MedEvolve, Inc
http://www.medevolve.com
Finn Tolderlund
2004-12-03 21:36:43 UTC
Permalink
Post by Jon Robertson
If I do this, will WordApp.PrintOut use the printer
specified above?
I believe so - but as I've never owned more than one
printer at a time, you might want to check. :)
Deborah Pate (TeamB) http://delphi-jedi.org
If you want to test you can just install another printer driver.
It shouldn't matter if the printer is there or not.
--
Finn Tolderlund
Marcelo
2004-12-03 16:58:02 UTC
Permalink
Tanks
Post by Marcelo
I need to let the user change the printer in my application
delphi x word, but only for that one document, and doesn't
want to change the default printer each time.
var
Basic: olevariant;
...
Basic := WordApp.WordBasic;
Basic.FilePrintSetup(
Printer := 'Canon BubbleJet 200e on LPT1',
DoNotSetAsSysDefault := 1);
--
Deborah Pate (TeamB) http://delphi-jedi.org
TeamB don't see posts sent via Google or ISPs
Use the real Borland server: newsgroups.borland.com
http://www.borland.com/newsgroups/genl_faqs.html
Continue reading on narkive:
Loading...