日期:2014-05-18 浏览次数:20904 次
void ToSheet_Example(){
 
  Visio.Shapes vsoShapes;
  Visio.Shape vsoShape;
  Visio.Shape vsoConnectTo;
  Visio.Connects vsoConnects;  
  Visio.Connect vsoConnect ;
  int intCurrentShapeIndex;
  int intCounter;
  vsoShapes = ActivePage.Shapes;
 
  //For each shape on the page, get its connections.
  for(intCurrentShapeIndex = 1;intCurrentShapeIndex <=vsoShapes.Count;intCurrentShapeIndex ++)
{
  vsoShape = vsoShapes(intCurrentShapeIndex) ;
  vsoConnects = vsoShape.Connects ;
  //For each connection, get the shape it connects to.
  for(intCounter = 1; intCounter <=vsoConnects.Count ;intCounter ++)
  {
  vsoConnect = vsoConnects(intCounter) ;
  vsoConnectTo = vsoConnect.ToSheet ;
  //Print the name of the shape the 
  //Connect object connects to. 
  Console.WriteLine(vsoConnectTo.Name); 
  }
  }
 
}