title: How to make a .NET app communicate with a VSTO Word Document-Level addin?
body: <p>I'm currently developing a VSTO Word Document-Level addin, and a WPF app. The WPF app uses the classes and methods in the <a href="https://msdn.microsoft.com/en-us/library/microsoft.office.interop.word(v=office.15).aspx" rel="nofollow">Microsoft.Office.Interop.Word.dll</a> assembly to open the Word DOCX file associated with the Document-Level addin.
  My WPF app needs to communicate with the VSTO Word Document-Level addin to update the document while the DOCX file is open.</p>
  
  <p>I found an article on the web called <a href="http://blogs.msdn.com/b/andreww/archive/2007/01/15/vsto-add-ins-comaddins-and-requestcomaddinautomationservice.aspx" rel="nofollow">VSTO Add-ins, COMAddIns and RequestComAddInAutomationService</a> that shows how to communicate to an Excel Addin from VBA. I thought I could use the same ideal to make my WPF app communicate with my VSTO Word Document-Level addin.</p>
  
  <p>The article describes how to override the <a href="https://msdn.microsoft.com/en-gb/library/microsoft.office.tools.addinbase.requestcomaddinautomationservice.aspx" rel="nofollow">RequestComAddInAutomationService</a> method in the add-in class. </p>
  
  <pre><code>public partial class ThisAddIn
  {
      private AddinUtilities addinUtilities;
  
      protected override object RequestComAddInAutomationService() 
      {
          if (addinUtilities == null)
          {
              addinUtilities = new AddinUtilities();
          }
  
          return addinUtilities;
      } 
  }
  </code></pre>
  
  <p>My  VSTO Word Document-Level  addin doesn't have a <code>ThisAddin</code> class that inherits from the <a href="https://msdn.microsoft.com/en-us/library/microsoft.office.tools.addinbase.aspx" rel="nofollow">Microsoft.Office.Tools.AddinBase</a> class. It has a <code>ThisDocument</code> class that inherits from the <a href="https://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.documentbase.aspx" rel="nofollow">Microsoft.Office.Tools.Word.DocumentBase</a> class. And the <code>DocumentBase</code> class doesn't contain a method called <code>RequestComAddInAutomationService</code> that can be overridden.</p>
  
  <p>So the question is, is it possible for another app to communicate with a VSTO Word Document-Level addin? And if so can you please show me a C# example of how to do it?</p>