如题。

解决方案 »

  1.   


    using System;
    using Visio;namespace TestVisio
    {
    class Class1
    {
    [STAThread]
    static void Main(string[] args)
    {
    ApplicationClass visio = new ApplicationClass();
    visio.Documents.Open(@"c:\绘图1.vsd");
    IVPage p = visio.ActivePage;
    IVShapes ss = p.Shapes; foreach (IVShape s in ss) 
    {
    short CustomPropertyCount = s.get_RowCount(243);
    if (CustomPropertyCount > 0) 
    {
    Console.WriteLine("Shape Index:{0}", s.Index);
    for (short i=0; i<CustomPropertyCount; i++)
    Console.WriteLine("\tLabel:{0}  Value:{1}", s.get_CellsSRC(243, i, 2).Formula, s.get_CellsSRC(243, i, 0).Formula);
    }
    }
    visio.ActivePage.Document.Close();
    visio.Quit();
    }
    }
    }
      

  2.   

    强啊,给分,顺便问下,能不能告诉我你哪里找到的?SDK,还是。。
    还有,写CustomProperties的时候怎么弄呢?我的msn:[email protected],加我啊,有好多问题请教呢。
      

  3.   

    if (s.get_SectionExists((short)tagVisSectionIndices.visSectionProp, (short)tagVisExistsFlags.visExistsAnywhere) == 0)
    s.AddSection((short)tagVisSectionIndices.visSectionProp);

    short rowIndex = s.AddRow((short)tagVisSectionIndices.visSectionProp, (short)tagVisRowIndices.visRowLast, 0);
    s.get_CellsSRC((short)tagVisSectionIndices.visSectionProp, rowIndex, 2).Formula = "";
    s.get_CellsSRC((short)tagVisSectionIndices.visSectionProp, rowIndex, 2).Formula = "\"ABC\"";