views:

201

answers:

2

I am trying to figure out how you can print a file, for example an excel spreadsheet using the Win32 Printing and Print Spooler Functions. I know the path of the file, but don't have a clue to send it to the print spooler.

A: 

to print an excel file, you will have to use excel (or write your own excel file parser - ouch). eg, via Automation. try googling: excel automation

steelbytes
I am speaking in the sense of programatically using the Win32 API (i.e. Printing and Printer Spooler Functions).
tool4scs
You will have to use the COM API for this.
Daniel
+1  A: 

You can call ShellExecute with lpOperation="print", see http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx

Note this will only work for document types that have the print verb defined, right click on a document you want to print and see if Print appears in the menu.

Tony Edgecombe