Creating charts with Visio
Microsoft Visio is a product used for creating charts and diagrams. Here we will show an example of how to create a simple flowchart with two connected shapes.
Getting ready
Microsoft Visio must be installed on the client machine.
Note
You may also need to download the Microsoft Office Interop Assemblies from Microsoft here:
How to do it...
Create a new C# Class Library project in Visual Studio.
Add the following code to the project:
using System; using System.Collections.Generic; using System.Runtime.InteropServices; using Microsoft.Office.Interop.Visio; namespace VisioSample { [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId("VisioNAV")] [ComVisible(true)] public class VisioNAV { Application VisioApp; Documents VisioDocs; Document visioStencil; List<Shape> shapes; public VisioNAV() { try { shapes = new List<Shape>(); VisioApp = new Application...