Exemple #1
0
 /// <summary>
 /// Formats the to Page similar to the from page and 
 /// copies all from FromPage to ToPage
 /// </summary>
 /// <param name="fromPage">Source page</param>
 /// <param name="toPage">Destination page</param>
 private void CopyPage(Visio.Page fromPage, Visio.Page toPage)
 {
     SetupDestinationPage(fromPage, toPage);
     //Copy shapes
     fromPage.AddGuide((short)Visio.VisGuideTypes.visPoint, 0, 0);
     Visio.Selection selection = fromPage.CreateSelection(Visio.VisSelectionTypes.visSelTypeAll);
     selection.Copy();
     toPage.Paste();
     Visio.Selection resultSelection = toPage.CreateSelection(Visio.VisSelectionTypes.visSelTypeAll);
     double origX, origY, newX, newY, dummy1, dummy2;
     selection.BoundingBox(1, out origX, out origY, out dummy1, out dummy2);
     resultSelection.BoundingBox(1, out newX, out newY, out dummy1, out dummy2);
     double diffX = origX - newX;
     double diffY = origY - newY;
     resultSelection.Move(diffX, diffY);
 }