title: VSTO - Can't get reference to Word.ApplicationFactory from external assembly
body: <h2>The Issue</h2>
  
  <p>We’ve got a VSTO Word Add-in that we’re trying to do integration tests with.</p>
  
  <p>We’ve organised into 3 projects as follows:</p>
  
  <ul>
  <li>VSTO Project</li>
  <li>Business Logic Project</li>
  <li>Test Project</li>
  </ul>
  
  <p>The issue is that in the test integration project we can create an instance of word using 
  new Microsoft.Office.Interop.Word.Application() however we are unable to get an instance of  Microsoft.Office.Tools.Word.ApplicationFactory  (VSTO interface).</p>
  
  <p>Does anyone know how I can get an instance of the VSTO ApplicationFactory in a test assembly?</p>
  
  <h2>For reference</h2>
  
  <p>The VSTO project makes calls to the business logic project passing</p>
  
  <ul>
  <li>Microsoft.Office.Interop.Word.Application</li>
  <li>Microsoft.Office.Tools.Word.ApplicationFactory</li>
  </ul>
  
  <p>In the business logic project we can get the active Microsoft.Office.Interop.Word.Document and call the interop document method GetVstoObject method passing in the factory</p>
  
  <pre><code>public Microsoft.Office.Tools.Word.Document VstoDocument
  {
      get { return _document.GetVstoObject(_factory); }
  }
  </code></pre>