I have created a VB .NET
application that opens files in their default application - extracts information and returns it to a listview on a form.
All of the code is in my main form. The main form has in it
Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop.Word
Imports Microsoft.Office.Interop.Excel
If in the future I want to modify my software to include another filetype not thought of in this release, am I better off for all of the filetypes I wish to open (including office) adding new classes for each filetype and including the 'Imports' in the individual classes?
So for example I would have:
- OpenFileDWG.vb
Imports Autodesk.AutoCAD.Runtime
OpenFileDOC.vb
Imports Microsoft.Office.Interop.Word
etc. etc. Is this a standard approach? If I were to do this, could I use:
If exists LCase(My.Computer.FileSystem.GetFileInfo(Filepath).Extension) THEN
strFileOpener = OpenFileDWG & Extension
Private fileOpener As strFileOpener
Would this approach work, or would I still need to reference the .dll in the main application, making this approach unworthy?
If I were to use this approach, could I just give the .vb file as part of an update?
Any advice is much appreciated.