T
Trev Hunter
Heya All,
Recently, I've implemented a simple document storage application. To cut a
long story short, it achieves this by:
1) User opens a file
2) File is read in and stored in another location my application (on a
server)
3) Icon appears in the application for the file
4) When the user wants to view the file, they double click the icon and the
file is transferred to the temporary folder and Process.Start is used to
launch the file so whatever viewer application is registered for the file is
launched (e.g. Word, Acrobat, Notepad etc.).
This part works fine, but does anybody have any ideas on how to print the
file from the application? Considering my application doesn't know the
structure of the files (it relies on whatever viewer application is
installed to do this), I'll need some common way of telling to viewer
application to print the file, instead of opening it.
My idea would be to somehow invoke the "Print" command that appears when you
right click on a file in explorer (which obviously requires the viewer
application to register the "Print" action for that file type when it is
installed).
Is there any way of doing this? I realise that not all file types can be
printed, but If I could get a way of seeing if "Print" is a registered
action for that file type and invoking it, it would do the job.
Many thanks for your suggestions and help,
Trev.
Recently, I've implemented a simple document storage application. To cut a
long story short, it achieves this by:
1) User opens a file
2) File is read in and stored in another location my application (on a
server)
3) Icon appears in the application for the file
4) When the user wants to view the file, they double click the icon and the
file is transferred to the temporary folder and Process.Start is used to
launch the file so whatever viewer application is registered for the file is
launched (e.g. Word, Acrobat, Notepad etc.).
This part works fine, but does anybody have any ideas on how to print the
file from the application? Considering my application doesn't know the
structure of the files (it relies on whatever viewer application is
installed to do this), I'll need some common way of telling to viewer
application to print the file, instead of opening it.
My idea would be to somehow invoke the "Print" command that appears when you
right click on a file in explorer (which obviously requires the viewer
application to register the "Print" action for that file type when it is
installed).
Is there any way of doing this? I realise that not all file types can be
printed, but If I could get a way of seeing if "Print" is a registered
action for that file type and invoking it, it would do the job.
Many thanks for your suggestions and help,
Trev.