hi, can we add References by coding, actually i m using ms word reference in my project but when ms word version changes, program get error, so i want to add MS office reference by coding, according to install version of ms office, pls help me
is there any other option by which msword dll work fine for all version of ms office meaning opening, editing file content.
thanks all
Loading
Dipti ShahPosted Dec 10, 2009, 7:47 AM
Assembly.LoadFromto load the assembly into memory, then you can useActivator.CreateInstanceto create an instance of your preferred type. You'll need to look the type up first using reflection. Here is a simple example: See http://www.codeguru.com/csharp/cshar...icle.php/c5881ishika singhPosted Dec 11, 2009, 6:10 AM
actually i want to open a exiting ms word file for all version of ms word and than modify this,
thanks
Dipti ShahPosted Dec 10, 2009, 7:53 AM
Activator.CreateInstance(assmblyFileName, typeName)to ask the .NET type resolution to resolve that into a type. You could wrap that with a try/catch so that if it fails, you can perform a search of directories where you may specifically store additional assemblies that otherwise might not be searched. This would use the preceding method at that point.