Page 1 of 1
Open and print textpad files using API
Posted: Mon Mar 10, 2008 7:32 pm
by sprathipati
Hi
Do we have any textpad API which i can use with .net ,if YES can you provide me the location where i can download?
My goal is to open the file in textpad,print and close it....all this should be done programmatically in .net
Thanks
Posted: Mon Mar 10, 2008 11:10 pm
by gan
This is pretty easy to do using .Net only (without textpad or any other text editor installed). Why do you want the dependency of textpad instead of doing this using .Net only?
Posted: Tue Mar 11, 2008 2:47 pm
by sprathipati
How can we do it in .net(Can you please provide me the link where i can find some examples).If we want to open a word file we use Microsoft.Office.Interop.Word, in the same way do we have any thing to open textpad files also.
Thanks
Saritha
Posted: Tue Mar 11, 2008 6:47 pm
by bveldkamp
You could use
ShellExecute() with the "print" verb, although that's is not managed code. The good thing is that it doesn't matter what type of file you supply, it will open the associated application and print it.
Or use Word to print textfiles? It will handle those just fine.