Board index » delphi » (TRichEdit)How can I setup a non-default printer to use?

(TRichEdit)How can I setup a non-default printer to use?

Hi,

I'm using method print() of RichEdit to print a RTF file.
However, RichEdit seems to use the system default printer always.
How can I setup a different printer from the system default printer?

Thanks,
Jennifer.

 

Re:(TRichEdit)How can I setup a non-default printer to use?


Try to make this:

Printer.PrinterIndex := n;  // where n = number of printer starting from
0

You can verify the available printers inspecting the Printers property
as follow

for i := 0 to Printer.Printers.Count - 1 do
 begin
    if Printer.Printers[ i ] = sWantedPrinter then
    begin
       n := i;
       exit;
    end;
 end;

The variable sWantedPrinter must be the name of the desired Printer as
you see in Control Panel.

Good Luck.

Jose Carlos.

jennifer nam gravada:

Quote
> Hi,

> I'm using method print() of RichEdit to print a RTF file.
> However, RichEdit seems to use the system default printer always.
> How can I setup a different printer from the system default printer?

> Thanks,
> Jennifer.

--
-----------------------------------------------------
Click here for Free Video!!
http://www.gohip.com/freevideo/

Re:(TRichEdit)How can I setup a non-default printer to use?


Thanks Jose,

I tried to create a new object of TPrinter and looked for the way to assign
this object to my RichEdit component.
However, I realized I can use global object "Printer" from your source code.

Thanks again,
Jennifer.

Jos Carlos da Silva wrote:

Quote
> Try to make this:

> Printer.PrinterIndex := n;  // where n = number of printer starting from
> 0

> You can verify the available printers inspecting the Printers property
> as follow

> for i := 0 to Printer.Printers.Count - 1 do
>  begin
>     if Printer.Printers[ i ] = sWantedPrinter then
>     begin
>        n := i;
>        exit;
>     end;
>  end;

> The variable sWantedPrinter must be the name of the desired Printer as
> you see in Control Panel.

> Good Luck.

> Jose Carlos.

> jennifer nam gravada:

> > Hi,

> > I'm using method print() of RichEdit to print a RTF file.
> > However, RichEdit seems to use the system default printer always.
> > How can I setup a different printer from the system default printer?

> > Thanks,
> > Jennifer.

> --
> -----------------------------------------------------
> Click here for Free Video!!
> http://www.gohip.com/freevideo/

Other Threads