开发者

Programmatically install VSTO add-ins

I´ve developed several VSTO add-ins for MS Office 2010. I need a way to register them from a 开发者_开发技巧C# program.

How can I do that?


Deploying a Visual Studio 2010 Tools for Office Solution Using Windows Installer

Deploying your VSTO Add-In to All Users (via HKLM)


To this registry key - HKCU\Software\Microsoft\Office\Word\Addins add your own RegistryKey with these values: (use Microsoft.Win32.RegistryKey class) Description (string) FriendlyName (string) Manifest (string) LoadBehavior (DWORD)

Manifest is absolute path to your VSTO addin + "|vstolocal" (for example: C:/myaddin.vsto|vstolocal)

LoadBehavior should be 3 - means: load at startup

FriendlyName and Description will be displayed in Word

But before first run of your addin you should execute your .vsto file (Notice that Visual Studio Tools for Office must be installed)

Process.Start("C:/myaddin.vsto");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜