添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have a VSTO addin which I want to invoke from a C# EXE. thisaddin.designer.cs file has a constructor as below.

Collapse | Copy Code

public ThisAddIn(global::Microsoft.Office.Tools.Word.ApplicationFactory factory, global::System.IServiceProvider serviceProvider) : 
          base(factory, serviceProvider, "AddIn", "ThisAddIn") {
        Globals.Factory = factory;

I have added the reference of Addin to my C# project and tried the below. But, not sure what arguments to pass.

Collapse | Copy Code

MTMWordAddIn.ThisAddIn addin = new MTMWordAddIn.ThisAddIn(null, null);

Kindly suggest. Thanks.

I want to create 3 seperate VSTO DLL's for different word versions (2007, 2010 & 2013). Use my EXE to invoke these DLL's after a Word version check on the client system. I don't want to deploy the VSTO Addin as Setup.exe. Rather I want to use my EXE to launch the VSTO dll's. – Guruprasad Mar 12, 2014 at 20:38

I am not sure if the approach above would work. I would rather make the exe to check for Word version and just change the vsto name in the registry entry.

When you install VSTO the registry will be added here

HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins

These registry key should have Manifest String Key and Value should be the path of the VSTO file. Your exe can look for the Word version and change the path in the registry entries.(This might need permission if the key is in HKEY_LOCAL_MACHINE).

Or rather use NetOffice which is compatible from Word 2000 to 2013

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.