sile
asked on
Detecting default printer !
How can I detect if there is a default printer selected ?
I don't need to know if there is a printer installed just if it there is a DEFAULT printer selected.
I don't need to know if there is a printer installed just if it there is a DEFAULT printer selected.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hmmm... Try this one.
function DefaultPrinter : STRING;
begin
if (Printer=nil) or (Printer.Printers=nil)
or (Printer.Printers.Count = 0)
then begin
Result := ''
end else begin
try
Printer.PrinterIndex := -1;
Result := Printer.Printers[Printer.P rinterInde x];
except
on Exception do Result := '';
end;
end;
end;
Regards,
Erik.
function DefaultPrinter : STRING;
begin
if (Printer=nil) or (Printer.Printers=nil)
or (Printer.Printers.Count = 0)
then begin
Result := ''
end else begin
try
Printer.PrinterIndex := -1;
Result := Printer.Printers[Printer.P
except
on Exception do Result := '';
end;
end;
end;
Regards,
Erik.
ASKER
Ok THANX it works now.
Bought this Q...
ASKER
Can you make it work in this case ?