Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Using Visio 2007

Using Visio 2007

Scheduled Pinned Locked Moved C#
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cdpace
    wrote on last edited by
    #1

    Helo, I need to create a dynamical organization chart using visio from C# code. Currently im using the following code only to test nothing special.

    if (openFileDialog1.ShowDialog() == DialogResult.OK)
    {
    axViewer1.SRC = openFileDialog1.FileName;
    Microsoft.Office.Interop.Visio.Application app = new Microsoft.Office.Interop.Visio.Application();
    Microsoft.Office.Interop.Visio.Page currentpage = app.Documents.Open(openFileDialog1.FileName).Pages[1];
    Microsoft.Office.Interop.Visio.Document stencil = app.Documents.OpenEx("Basic_U.vss", (short)Microsoft.Office.Interop.Visio.VisOpenSaveArgs.visOpenDocked);
    //Microsoft.Office.Interop.Visio.Window stencilwindow = currentpage.Document.OpenStencilWindow();
    //app.SaveWorkspaceAs(@"C:\Users\Chris\Desktop\tezt.vsd");

                    Microsoft.Office.Interop.Visio.Shape shape2 = currentpage.Drop(stencil.Masters\["Square"\], 10, 7.50);
    
                    // create a dynamic connector from the stencil master collection
                    Microsoft.Office.Interop.Visio.Shape connector = currentpage.Drop(stencil.Masters\["Dynamic connector"\], 4.50, 4.50);
    
                    
                }
    

    now the problem is here. On my computer the application is working fine because i have Visio 2007 installed and shapes are added etc.. but when the application is going to be used by the clients and they dont have visio installed the whole applicaiton wont work. Is there a way which i can create the charts dynamicaly at runtime without visio being installed??

    D 1 Reply Last reply
    0
    • C cdpace

      Helo, I need to create a dynamical organization chart using visio from C# code. Currently im using the following code only to test nothing special.

      if (openFileDialog1.ShowDialog() == DialogResult.OK)
      {
      axViewer1.SRC = openFileDialog1.FileName;
      Microsoft.Office.Interop.Visio.Application app = new Microsoft.Office.Interop.Visio.Application();
      Microsoft.Office.Interop.Visio.Page currentpage = app.Documents.Open(openFileDialog1.FileName).Pages[1];
      Microsoft.Office.Interop.Visio.Document stencil = app.Documents.OpenEx("Basic_U.vss", (short)Microsoft.Office.Interop.Visio.VisOpenSaveArgs.visOpenDocked);
      //Microsoft.Office.Interop.Visio.Window stencilwindow = currentpage.Document.OpenStencilWindow();
      //app.SaveWorkspaceAs(@"C:\Users\Chris\Desktop\tezt.vsd");

                      Microsoft.Office.Interop.Visio.Shape shape2 = currentpage.Drop(stencil.Masters\["Square"\], 10, 7.50);
      
                      // create a dynamic connector from the stencil master collection
                      Microsoft.Office.Interop.Visio.Shape connector = currentpage.Drop(stencil.Masters\["Dynamic connector"\], 4.50, 4.50);
      
                      
                  }
      

      now the problem is here. On my computer the application is working fine because i have Visio 2007 installed and shapes are added etc.. but when the application is going to be used by the clients and they dont have visio installed the whole applicaiton wont work. Is there a way which i can create the charts dynamicaly at runtime without visio being installed??

      D Offline
      D Offline
      Deresen
      wrote on last edited by
      #2

      I don't think so, it's like getting on a train where you didn't buy a trainticket. If the app doesn't work, try the 'try-catch' method around the area's where you are trying to do something with the visio files. edit: wtf... I wrote around with a T, I'm soo ashamed of myself :wtf:

      C 1 Reply Last reply
      0
      • D Deresen

        I don't think so, it's like getting on a train where you didn't buy a trainticket. If the app doesn't work, try the 'try-catch' method around the area's where you are trying to do something with the visio files. edit: wtf... I wrote around with a T, I'm soo ashamed of myself :wtf:

        C Offline
        C Offline
        cdpace
        wrote on last edited by
        #3

        No the application works fine on my computer where i have visio installed but it dosent work on the other computer im testing it on that dosen't have visio installed. Is there some other librariy that i can use to draw charts. Because to be honest the main reason im using this is to create a family tree.

        D D 2 Replies Last reply
        0
        • C cdpace

          No the application works fine on my computer where i have visio installed but it dosent work on the other computer im testing it on that dosen't have visio installed. Is there some other librariy that i can use to draw charts. Because to be honest the main reason im using this is to create a family tree.

          D Offline
          D Offline
          Deresen
          wrote on last edited by
          #4

          If you just want to draw charts you can 1. make your own library 2. use an external library. You could use Dundas Charting (you've got to pay for this) or you can use something like this: charts[^]

          1 Reply Last reply
          0
          • C cdpace

            No the application works fine on my computer where i have visio installed but it dosent work on the other computer im testing it on that dosen't have visio installed. Is there some other librariy that i can use to draw charts. Because to be honest the main reason im using this is to create a family tree.

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #5

            Unfortunately you need visio installed to use the Visio COM Interop Objects. :doh:

            Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups