【发布时间】:2013-12-02 22:53:09
【问题描述】:
我最近开始使用 C#,我必须导入一个包含不同路径的流程图的 Visio 文件。
我用这段代码加载文件。
public Container loadFile(string fileName)
{
Microsoft.Office.Interop.Visio.Application app = new Microsoft.Office.Interop.Visio.Application();
app.Visible = false;
Documents docs = app.Documents;
Document doc = docs.Open(fileName);
Microsoft.Office.Interop.Visio.Page page = doc.Pages[1];
Container container = printProperties(page.Shapes);
return container;
}
public Container printProperties(Microsoft.Office.Interop.Visio.Shapes shapes)
{
Container container = new Container("Visio Import");
container.setParent(null);
// Look at each shape in the collection.
foreach (Microsoft.Office.Interop.Visio.Shape shape in shapes)
{
// traverse
}
return container;
}
我想遍历流程图的所有可能 (!) 路径并打印流程名称。例如
Path 1:
- Enter PIN
- Select Account
- Select Amount
- Print Receipt
- Take Money
Path 2:
- Enter PIN
- Select Account
- Check Money
- Abort
你能告诉我如何检查单个进程之间的连接并遍历它吗?非常感谢您的帮助!
【问题讨论】:
标签: c# visual-studio-2010 ms-office visio