Adding reference at runtime
-
I'm creating a component in VB.NET which acts as kind of a wrapper for Ms Outlook 2003 and Ms Word 2003. There are three components which can be used seperately. Now when I want to use the Outlook component, I don't want to load the Word assemblies and vice versa, but I dot want the controls within a single assembly. Is it possibly to create the references to the required Office Interop Assemblies at runtime (in the constructors for example) so when loading my assembly, not needed office resources will be left alone? For example, when using the Outlook control, my assembly loads Office.Core.dll and Office.Outlook.dll and NOT Office.Word.dll
I love it when a plan comes together
-
I'm creating a component in VB.NET which acts as kind of a wrapper for Ms Outlook 2003 and Ms Word 2003. There are three components which can be used seperately. Now when I want to use the Outlook component, I don't want to load the Word assemblies and vice versa, but I dot want the controls within a single assembly. Is it possibly to create the references to the required Office Interop Assemblies at runtime (in the constructors for example) so when loading my assembly, not needed office resources will be left alone? For example, when using the Outlook control, my assembly loads Office.Core.dll and Office.Outlook.dll and NOT Office.Word.dll
I love it when a plan comes together
Did you try using classes in the System.Reflection[^] namespace? They allow you to load assemblies at runtime, which is exactly what you want to do. Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
I'm creating a component in VB.NET which acts as kind of a wrapper for Ms Outlook 2003 and Ms Word 2003. There are three components which can be used seperately. Now when I want to use the Outlook component, I don't want to load the Word assemblies and vice versa, but I dot want the controls within a single assembly. Is it possibly to create the references to the required Office Interop Assemblies at runtime (in the constructors for example) so when loading my assembly, not needed office resources will be left alone? For example, when using the Outlook control, my assembly loads Office.Core.dll and Office.Outlook.dll and NOT Office.Word.dll
I love it when a plan comes together
The previous reply hits it on the head, but be warned that if you use Word as the Outlook email editor, it will load Word components regardless. ...Steve