I depends on how you are accessing the component object model, which is the only way to get access to the automation server.
If you are using inferfaces only, it should not become very complicated.
The files you need are mso.dll and msword.olb. Just try to import a reference to msword.olb, which is always located at the installation directory of MS Office, Visual Studio will do the rest for you. Or you can use tlbimp.exe on both files.
Then try something like the following
| privateboolInitWordInstance(refWord.ApplicationappWord) |
| { |
| try |
| { |
| TypecomType=Type.GetTypeFromProgID("Word.Application"); |
| if(comType==null)returnfalse; |
| appWord=Activator.CreateInstance(comType)asWord.Application; |
| returnappWord!=null; |
| } |
| catch(System.Reflection.TargetInvocationException) |
| { |
| } |
| catch(System.Runtime.InteropServices.COMException) |
| { |
| } |
|
|
| returnfalse; |
| } |
This should not be troblesome, as long as you use common functions only.
regards,
franking