title | ms.service | ms.assetid | ms.date | ms.localizationpriority |
---|---|---|---|---|
Shapes.AddLine method (Project) |
project-server |
697a5972-4b24-8e77-b42f-b064019906fa |
06/08/2017 |
medium |
Adds a line to a report, and returns a Shape object that represents the line.
expression. AddLine
(BeginX, BeginY, EndX, EndY)
expression A variable that represents a Shapes object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
BeginX | Required | Single | The horizontal position (in points) of the starting point, relative to the left edge of the report. |
BeginY | Required | Single | The vertical position (in points) of the starting point, relative to the top edge of the report. |
EndX | Required | Single | The horizontal position (in points) of the end point, relative to the left edge of the report. |
EndY | Required | Single | The vertical position (in points) of the end point, relative to the top edge of the report. |
BeginX | Required | FLOAT | |
BeginY | Required | FLOAT | |
EndX | Required | FLOAT | |
EndY | Required | FLOAT | |
Name | Required/Optional | Data type | Description |
Shape
To format the line, use the Shape.Line property.
The following example creates a violet dashed line with an arrow at the end.
Sub AddBigArrow()
Dim shapeReport As Report
Dim reportName As String
Dim lineShape As shape
' Add a report.
reportName = "Line report"
Set shapeReport = ActiveProject.Reports.Add(reportName)
Set lineShape = shapeReport.Shapes.AddLine(20, 50, 320, 100)
With lineShape.Line
.DashStyle = msoLineDashDot
.Weight = 3
.EndArrowheadStyle = msoArrowheadTriangle
.EndArrowheadWidth = msoArrowheadWidthMedium
.ForeColor.RGB = &HFF0090
End With
End Sub
Shapes Object Shape Object Line Property
[!includeSupport and feedback]