Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have task to open any file e.g. xls, doc, msg, eml, pdf etc. and save them as in different format and wondering somebody can give me the code would me great.

Thank you in advance:)
Posted
Updated 25-Feb-16 13:00pm
Comments
[no name] 4-Feb-16 0:13am    
This question contains no evidence that you have given the matter serious thought. If you wish to pursue this mission begin by writing a basic requirements scope for this convertor.

First, no such converter exists because you'd have to write an interpreter for every file format you want to read. Good luck with that.

Next, nobody here is just going to "give you code" to do this. That's not how this, nor any other, site works. The only code you code is the code YOU write.
 
Share this answer
 
Comments
Aravindba 25-Feb-16 20:36pm    
Hi,i agree with second point,but for 1st we have lot of converters in the marking but need to buy or we get trail version.
Anyway i give 5+ for send point.
Try
How to convert DOC into other formats using C#[^]

Alternately, you can look at various third party components like .NET PDF Component - Create Convert PDF Files in VB.NET[^].
 
Share this answer
 
Thank you all who submitted their suggestions

After research I found the best solution would be to use PowerShell codes to make this happen. I had work out to open any file using below code:

$FileOpen = "C:\Test.xls"
Invoke-Item $FileOpen


This code allows to open a file, now I have to find to save this open file. Any ideas?

Happy Friday:)
 
Share this answer
 
Comments
Dave Kreskowiak 25-Feb-16 21:27pm    
All that does is launch the application with the file just like you double-clicked the file itself.

You have no way of automating every single application to cause it to resave the file is another format. Again, you'd have to write code for every application you want to support and a lot of applications don't expose any kind of automation interface that you can use from your PowerShell script or any other code for that matter.

There is simply no practical way to "support any file format" with a minimum amount of code. Also, some file formats do not make sense in other formats
AKA417 25-Feb-16 23:32pm    
What about if we can control the open file window with PowerShell! then I think we don't require interface.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900