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 Shah6 reputationPosted Dec 10, 2009, 2:47 AM EST
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:Assembly assembly = Assembly.LoadFrom("MyNice.dll"); Type type = assembly.GetType("MyType"); object instanceOfMyType = Activator.CreateInstance(type);Dipti Shah6 reputationPosted Dec 10, 2009, 2:53 AM EST
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.ishika singh17 reputationPosted Dec 11, 2009, 1:10 AM EST
actually i want to open a exiting ms word file for all version of ms word and than modify this,
thanks