Visio Automation: Three Hello World Samples – C#, F#, and IronPython

This blog post has moved

Go to:

Comments (1)

  1. Himanshu says:


    I am trying to integrate Visio 2007 with C# (VS 2012 and windows 7 OS) but I am getting error while running the code

    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)).

    Code snippet :

        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";

    .I have Microsoft office 2010 installed with Visio 2007 on my machine.