Accessing Shared Assembly From MSWord

I want to access a C# shared assembly from MSWord.  The assembly was built in Visual Studio with a keyfile, and put into c:\winnt\assembly using "gacutil /i".  But in the VBA editor, I'm unable to find the assembly under Tools/References, and when I click on Browse, and go to c:\winnt\assembly\GAC_MSIL\....\test.dll, I get an error message:  "Can't add a reference to the specified file".

This is MSWord 2002 SP3.

jkavx
jkavxAsked:
Who is Participating?
 
dstanley9Connect With a Mentor Commented:
Actually, I think it is possible to use .NET assemblies in Office 2003 if you use the Visual Studio Tools for Office (it's not free, however):

http://msdn.microsoft.com/vstudio/products/vsto/
0
 
NazermohideeenCommented:
I believe that office 2002 does not use the .net framework.

you will have to upgrade to office 2003 and instal the latest service pack

You can still use vb6 / vc++ libraries

NM
0
 
dstanley9Commented:
Word will not let you use CLR assemblies directly.  You either need to make your classes COM-visible or create a CCW for your assembly.  Depending on how complex your interfaces are, this may or may not be possible without marshalling data in some medium (e.g. XML).

Here are a few articles to help you out:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp
http://www.devcity.net/Articles/28/1/20020328.aspx
0
 
jkavxAuthor Commented:

Do you need a CCW for Word/Excel/Ppt/Visio in Office 2003?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.