title: Com Error while integrating vs 2012 C# with visio 2007
body: <p>I am trying to integrate Visio 2007 with C# (VS 2012 and windows 7 OS) but I am getting error while running the code</p>
  
  <p>Unable to cast COM object of type 'Microsoft.Office.Interop.Visio.ApplicationClass' to interface type 'Microsoft.Office.Interop.Visio.IVApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000D0700-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).</p>
  
  <p>Code snippet :</p>
  
  <p>using IVisio = Microsoft.Office.Interop.Visio; </p>
  
  <p>Inside method</p>
  
  <pre><code> var app = new IVisio.ApplicationClass();
          var docs = app.Documents;  (Error coming at this point)
          var doc = docs.Add("");
  
          var page = app.ActivePage;
          var shape0 = page.DrawRectangle(1, 2, 6, 3);
          shape0.Text = "Hello World";
  </code></pre>
  
  <p>I have Microsoft office 2010 installed with Visio 2007 on my machine.</p>
  
  <p>Reference Library : Microsoft.Office.Interop.Visio (tried Microsoft Visio 12 Type Library  version 4.12.0.0 (visio 2007) and  version  14.0.0.0 (visio 2010) but getting the same error.)</p>