From: xavier@xapware.com (Xavier Pacheco (TeamB)) Subject: Re: Printer Bins? - How to Print to? Date: 02 Nov 1999 00:00:00 GMT Message-ID: <3825fe5f.332978928@forums.inprise.com> Content-Transfer-Encoding: 7bit References: <381EB568.8AD46BC@wtsw.net> Content-Type: text/plain; charset=us-ascii Organization: Xapware Technologies Inc. Mime-Version: 1.0 Reply-To: xavier@xapware.com Newsgroups: borland.public.delphi.winapi Duane, Try this: procedure ChangePrinterBin(ToBin: Integer); var ADevice, ADriver, APort: array [0..255] of Char; DeviceHandle: THandle; DevMode: PDeviceMode; // A Pointer to a TDeviceMode structure begin { First obtain a handle to the TPrinter's DeviceMode structure } Printer.GetPrinter(ADevice, ADriver, APort, DeviceHandle); { If DeviceHandle is still 0, then the driver was not loaded. Set the printer index to force the printer driver to load making the handle available } if DeviceHandle = 0 then begin Printer.PrinterIndex := Printer.PrinterIndex; Printer.GetPrinter(ADevice, ADriver, APort, DeviceHandle); end; { If DeviceHandle is still 0, then an error has occurred. Otherwise, use GlobalLock() to get a pointer to the TDeviceMode structure } if DeviceHandle = 0 then Raise Exception.Create('Could Not Initialize TDeviceMode structure') else DevMode := GlobalLock(DeviceHandle); with DevMode^ do begin dmFields := DM_DEFAULTSOURCE; dmDefaultSource := ToBin; end; if not DeviceHandle = 0 then GlobalUnlock(DeviceHandle); end; -- x ============================== Xavier Pacheco (TeamB) xavier@xapware.com Sorry but TeamB cannot answer support questions received via email.