I am trying to create "Curved Connectors Ends with Arrow" between two rectangale objects using following code.
For the moment I'm using connecter but I need to use "Curved Connectors Ends with Arrow". Please help me out.
Code: Select all
Function AddConnectorShape(oDoc, oMyPages, Rectangle1, Rectangle2) As Object
Connectorshape = oDoc.createInstance("com.sun.star.drawing.ConnectorShape")
'Add the connector shape before setting the glue points, although the gluepoint shapes
'could be obtained by using the shape name instead of the index
oMyPages.Add (Connectorshape)
'Add the glue points to the connector
'Get Rectangle 1
Connectorshape.StartShape = Rectangle1
'ConnectorShape.StartShape = ConnectorCurve
Connectorshape.StartGluePointIndex = 2 'Connect to the bottom
'Rectangle 2
Connectorshape.EndShape = Rectangle2
Connectorshape.EndGluePointIndex = 0 'Connect to the top
'Use arrows on the connector line
Connectorshape.LineEndName = "Arrow"
AddConnectorShape = Connectorshape
End Function
Callout code:
Code: Select all
strRecTxt = Worksheets("Sheet1").Cells(1,1)
PropVal(0).Name = "Type"
PropVal(0).Value = "round-rectangular-callout" '"rectangular-callout"
Doc = ThisComponent
Sheet = Doc.Sheets.getByName(WS.Name)
DrawPage = Sheet.DrawPage
Callout = Doc.createInstance("com.sun.star.drawing.CustomShape")
DrawPage.add(Callout)
CalloutShape = DrawPage.getByIndex(DrawPage.count-1)
Callout.CustomShapeGeometry = PropVal()
Callout.FillColor = RGB(255,255,255)
Callout.LineColor = RGB(0,0,0)
Callout.Position = Point 'Pos
Callout.Size = Size
Callout.String = calloutmesg
DrawPage.add(Callout)
Thanks in advance.
Best Regards,
Vinod