Issue in using Visio Interop with sharepoint 2010 (programatically) RRS feed

  • Question

  • Hi,

    I am facing difficulty in opening a Visio document(.vdw) programatically, which is published under sharepoint 2010 document library.

    Idea is to have a sharepoint site page, which will execute below code to generate and display the visio diragram dynamically.


    public void GenerateDiagram()
                    Microsoft.Office.Interop.Visio.Application application = new Microsoft.Office.Interop.Visio.Application();
                    application.Visible = false;
                    Microsoft.Office.Interop.Visio.Document doc = application.Documents.Open("http://ssp/sites/portal/Visio Library/sam.vdw"); 
    // I have tried the path like : @"E:\Visio\sam.vdw".

    Right now above code throws an error like "File not found" (if i specify absolute URL) , and invalid file format(in case of relative URL).

    FYI , same code works when i execute in console or class library application (removing RunWithElevatedPrivileges).

    If you have any alternatives, please suggest me.

    I had gone through the thread

    and also

    which says interop cant be used in sharepoint server side.

    If i can do the same task in client side(Java script or JQuery), please enlighten me with how to do it.

    Any help in this regard is much appreciated.

    Thanks in advance. 
    Ravi Bhat

    Thursday, May 2, 2013 12:22 PM


All replies