Home
TeamSite
c# .net vs2005 offic
EvDev
I'm creating a c# .net add-in for office 2003 in VS 2005. What references do I need to add for Interwoven in order to be able to reference NRTIDs?
Thanks
Find more posts tagged with
Comments
jny
There is no FileSite type library to reference so that you can consume WorkSite objects in your own COM-AddIn. FileSite is integrated with Outlook using MAPI, and it also uses different extention type libraries to talk to the WorkSite back-end.
What do you mean by NRTID's? Is it an Outlook Add-In or something else? What are you trying to do in your Add-In?
EvDev
I'm sorry, I'm not being very clear.
This Add-in is for Word, PowerPoint and Excel. I'm actually migrating something that is in vba and am translating it to c#.net.
This is the code I need to migrate to C#:
Dim mydoc As Variant 'IManage.NRTDocument
Dim MyExtObject As iManO2K.iManageExtensibility
Dim objCOMAddIn As Office.COMAddIn
Dim objWordApp As Word.Application
Set objWordApp = Word.Application
Set objCOMAddIn = objWordApp.COMAddIns("iManO2K.AddinForWord2000")
Set MyExtObject = objCOMAddIn.Object
modMain.OpenExplorer mydoc.ID, mydoc.Database
jny
The iManO2K.dll which is COM needs to be converted to interop assembly in order for users to reference it successfully in a .NET project. Today I believe we rely on .NET's compiler to build the correct interop assembly for the iManO2K.dll and it is that interop assembly that .NET users reference. As it turned out that was not a very reliable method as the interop assembly did not seem to be converted correctly; hence the issue.
When attempting to reference the COM addIn from .NET a conflict appears to occur between the designer object that is referenced in your COM addIn and the Primary Interop Assembly that is installed with VS.NET and which provides equivalent COM addIn (IDTExtensibility2) functionality namely the Extensibility assembly. Strictly speaking, therefore, the issue would not appear to be a WorkSite issue as other users can reproduce the behaviour with other non-WorkSite APIs that reference this designer object.
To deal with the issue we'd recommend that you manually create the necessary interop assemblies using Visual Studio's Type Library to Assembly Converter (tlbimp.exe). Specifically when manually creating an interop for the iManO2k Type Library, you should explicitly specify the assembly reference rather than leaving it to the .NET framework to decide which is the best available reference.
As an example, first you should create an assembly for the IManage and IManExt Type Libraries from a VS.NET command prompt as follows:
tlbimp %ProgramFiles%\Interwoven\WorkSite\IManage.dll /out:MyCompany.Interop.IManage.dll /namespace:IManage /sysarray tlbimp %ProgramFiles%\Interwoven\WorkSite\IManExt.dll /out:MyCompany.Interop.IManExt.dll /namespace:IMANEXTLib sysarray /reference:MyCompany.Interop.IManage.dll
Next, create the interop for the MS Add-In Designer type library as follows:
tlbimp %CommonProgramFiles%\Designer\MSADDNDR.TLB /out:MyCompany.Interop.AddInDesignerObjects.dll /namespace:AddinDesignerObjects /sysarray
Lastly, create the interop for the iManO2k type library (in this example iManOXP.DLL):
tlbimp %ProgramFiles%\Interwoven\WorkSite\iManOXP.dll /out:MyCompany.Interop.IManOXP.dll /namespace:iManO2k /sysarray /reference:MyCompany.Interop.IManage.dll /reference:MyCompany.Interop.IManExt.dll /reference:MyCompany.Interop.AddinDesignerObjects.dll
Note in the above examples that I've explicitly set which referenced assemblies to use rather than letting the tool decide for itself. In any VS.NET project the resulting 4 interop assemblies should be used instead of referencing the COM libraries directly.
I believe the Office Integration developer will be using the above method to establish the interop assemblies for the next major release.