无需重新加气的 COM 互操作 [英] COM Interop without regasm
问题描述
我是一个受限用户,我需要编写一个 Outlook 宏来公开 Outlook 2003 和 2007 中的 C# 库.
I'm a limited user, and I need to write an Outlook macro that exposes a C# library in Outlook 2003 and 2007.
我根本没有任何管理员权限,甚至在安装时也没有,所以我无法运行 RegAsm,也无法(我假设)编写托管加载项.
I do not have any admin privilges at all, not even at install time, so I can't run RegAsm and I can't (I assume) write a managed add-in.
在这种情况下,有没有办法从 VBA 调用 .Net 代码,或者有其他解决方案吗?
Is there any way to call .Net code from VBA in this scenario, or are there any other solutions?
这仅供个人使用,所以丑陋的黑客是完全可以接受的(只要它有效)
This is for personal use only, so an ugly hack is perfectly acceptable (so long as it works)
推荐答案
我通过运行带有 /regfile
选项的 regasm
解决了这个问题,并在生成的 .reg
文件.
I solved this by running regasm
with the /regfile
option, and replacing HKLM with HKCU in the resulting .reg
file.
这篇关于无需重新加气的 COM 互操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!