In my recent project, I can open and process any office files using the Interop in C#, as long as I know their file types (e.g., ".doc", ".xlsm"".ppt", etc.), and a specific application (e.g., Word or Excel) will be chosen to open the file.
My question is that, is there a unique way to open an office file and process it using Interop in C#? Thanks.
Edited: For instance, given a ".doc" file, I will use Microsoft.Office.Interop.Word to open it. Is there a way in C# to know which application (i.e, Microsoft.Office.Interop.Word, Microsoft.Office.Interop.Excel, Microsoft.Office.Interop.PowerPoint) is associated to open a given file type use interop (I need to use interop to do some processing)?
One way to do it is to store a table with associated application according to difference file types. Is there a better way?