是否可以从Word 2007文件中包含的Visual Basic代码中调用C#dll? [英] Is it possible to call C# dlls from Visual Basic code contained in a Word 2007 file?
问题描述
我有一些Visual Basic方法充当自定义Word功能区的单击处理程序.不幸的是,我已经实现了处理程序必须用C#编写的实现,该处理程序已作为XML扩展包加载到Word文档中.
I have some Visual Basic methods that are acting as the click handlers for a custom Word Ribbon. Unfortunately, I already have the implementation of what the handlers have to do written in C# which is loaded into the Word document as an XML Expansion Pack.
我看不到将对C#.dll的引用添加到Word的Visual Basic编辑器的任何方法.这可能吗?
I don't see any way to add a reference to the C# .dlls to Word's Visual Basic Editor. Is this possible?
推荐答案
C#组件必须公开一个COM接口. http://msdn.microsoft.com/en-us/library/c3fd4a20. aspx .
The C# component would have to expose a COM interface. http://msdn.microsoft.com/en-us/library/c3fd4a20.aspx.
这篇关于是否可以从Word 2007文件中包含的Visual Basic代码中调用C#dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!