title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Shapes.AddConnector method (Project) |
project-server |
bfd75cf3-f70b-8d19-bf28-94e2f4b227dd |
06/08/2017 |
medium |
Creates a connector and returns a Shape object the represents the new connector.
expression.AddConnector (Type, BeginX, BeginY, EndX, EndY)
expression A variable that represents a Shapes object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Required | MsoConnectorType | The type of connector. Can be one of the following constants: msoConnectorElbow, msoConnectorTypeMixed, msoConnectorCurve, or msoConnectorStraight. |
BeginX | Required | Single | The horizontal position (in points) of the connector's starting point, relative to the upper-left corner of the document. |
BeginY | Required | Single | The vertical position (in points) of the connector's starting point. |
EndX | Required | Single | The horizontal position (in points) of the connector's end point. |
EndY | Required | Single | The vertical position (in points) of the connector's end point. |
Type | Required | MSOCONNECTORTYPE | |
BeginX | Required | FLOAT | |
BeginY | Required | FLOAT | |
EndX | Required | FLOAT | |
EndY | Required | FLOAT | |
Name | Required/Optional | Data type | Description |
Shape
Note
In Project, the methods to attach the beginning and end of a connector to other shapes in the report (ConnectorFormat.BeginConnect and ConnectorFormat.EndConnect) don't work. Use only the AddConnector parameters to position the connector. For more information, see the ConnectorFormat property.
The following example creates a report that contains two cloud shapes, and then adds a blue-green curved connector line that is two points wide.
Sub ConnectClouds()
Dim shapeReport As Report
Dim reportName As String
Dim connectorShape As shape
' Add a report.
reportName = "Cloud report"
Set shapeReport = ActiveProject.Reports.Add(reportName)
' Add two clouds.
Dim cloudShape1 As shape
Dim cloudShape2 As shape
Set cloudShape1 = shapeReport.Shapes.AddShape(msoShapeCloud, 20, 20, 100, 60)
Set cloudShape2 = shapeReport.Shapes.AddShape(msoShapeCloud, 100, 200, 60, 100)
Set connectorShape = shapeReport.Shapes.AddConnector(msoConnectorCurve, 80, 80, 130, 200)
With connectorShape
.Line.Weight = 2
.Line.ForeColor.RGB = &HAAFF00
End With
End Sub
Shapes Object Shape Object ConnectorFormat Property AutoShapeType Property MsoConnectorType
[!includeSupport and feedback]