ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printer name from handle (https://www.excelbanter.com/excel-programming/285448-printer-name-handle.html)

Eje

Printer name from handle
 
I need the printer name to printout an Excel worksheet.

CommonDlg returns a handle to the chosen printer while
the printout command needs the printername. The "newer"
PrinterDlg may return the printername but instead needs a
handle to a window. What window is unclear. User32.dll
can return a window's handle but need a frameclass which
a can't find.

Tom Ogilvy

Printer name from handle
 
Perhaps you can use this. It will set the printer.

application.Dialogs(xlDialogPrinterSetup).Show

--
Regards,
Tom Ogilvy

"Eje" wrote in message
...
I need the printer name to printout an Excel worksheet.

CommonDlg returns a handle to the chosen printer while
the printout command needs the printername. The "newer"
PrinterDlg may return the printername but instead needs a
handle to a window. What window is unclear. User32.dll
can return a window's handle but need a frameclass which
a can't find.




Eje

Printer name from handle
 
Many thanks, Tom. You gave me an accepable solution.
Eje

-----Original Message-----
Perhaps you can use this. It will set the printer.

application.Dialogs(xlDialogPrinterSetup).Show

--
Regards,
Tom Ogilvy

"Eje" wrote in

message
...
I need the printer name to printout an Excel worksheet.

CommonDlg returns a handle to the chosen printer while
the printout command needs the printername. The "newer"
PrinterDlg may return the printername but instead

needs a
handle to a window. What window is unclear. User32.dll
can return a window's handle but need a frameclass

which
a can't find.



.



All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com