Is it possible to connect tow ShapeEx shapes with ConnectorEx shape?
In Powerpoint pia it would happen like this:
s = BaseSlide.Shapes.AddConnector(Microsoft.Office.Core.MsoConnectorType.msoConnectorCurve, 1, 1, 1, 1);
Enclosed is a pptx file, where you can see a correctly connected connector between two rectangles and a not so correctly connected one between ellipses.
The connector is not a mere arrow; it keeps the connection, while you move the connected shapes. You can try this with the rectangles.
If you click on the shape, you can see the red dots in the end of the shape, Now if you move the red dot (or the end of the connector)over the shape, you can see connection points on the sides of the shape. Those are point where you should connect the connector.
The ellipses are connected in suboptimal way, but if you select the connector and right-click it, you can find a “Reroute connectors” selection. By clicking it, PowerPoint calculates shortest route between the shapes.
PresentationEx pres = new PresentationEx();SlideEx slide = pres.Slides;int id = slide.Shapes.AddConnector(ShapeTypeEx.StraightConnector1 , 200, 300, 40, 70);ShapeEx conn = slide.Shapes[id];// Set connector styleConnectorEx con = (ConnectorEx)conn;con.ShapeStyle.EffectStyleIndex = 2;con.LineFormat.FillFormat.SolidFillColor.Color = Color.Red ;con.LineFormat.Width = 5;pres.Write(“D:\Connector.pptx”);