Table of contents
TOC
Collapse the table of content
Expand the table of content

Shapes.AddLine Method (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Adds a line to a report, and returns a Shape object that represents the line.

Syntax

expression. AddLine(BeginX,BeginY,EndX,EndY)

expression A variable that represents a Shapes object.

Parameters

NameRequired/OptionalData TypeDescription
BeginXRequiredSingleThe horizontal position (in points) of the starting point, relative to the left edge of the report.
BeginYRequiredSingleThe vertical position (in points) of the starting point, relative to the top edge of the report.
EndXRequiredSingleThe horizontal position (in points) of the end point, relative to the left edge of the report.
EndYRequiredSingleThe vertical position (in points) of the end point, relative to the top edge of the report.
BeginXRequiredFLOAT
BeginYRequiredFLOAT
EndXRequiredFLOAT
EndYRequiredFLOAT
NameRequired/OptionalData typeDescription

Return value

Shape

Remarks

To format the line, use the Shape.Line property.

Example

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

See also

Other resources

Shapes ObjectShape ObjectLine Property

© 2018 Microsoft