views:

609

answers:

1

How can I allow the user of a WPF application to print PDF, Word, Excel and Powerpoint files without opening them, i.e. show a ComboBox of all files available, user clicks on one, Print dialog opens, user clicks OK and it prints to his desired printer?

+2  A: 

Just a guess: Use ShellExecute(Ex) with the verb "print". I don't know if System.Diagnostics.Process supports specifying the verb, but you can import the original function into a .NET application. That relies on the user having appropriate applications installed, but then, if you don't want to open the files, someone else has to.

I guess you don't want the route through office automation, do you? In that case, once you got how it works and learned about its quirks, you have a more powerful way to do anything the applications support.

OregonGhost