SetSegmentType Method

Microsoft Word Visual Basic

Sets the segment type of the segment that follows the node specified by Index. If the node is a control point for a curved segment, this method sets the segment type for that curve. Note that this may affect the total number of nodes by inserting or deleting adjacent nodes.

expression.SetSegmentType(Index, SegmentType)

expression    Required. An expression that returns a ShapeNodes object.

Index    Required Long. The node whose segment type is to be set.

SegmentType   Required MsoSegmentType. Specifies if the segment is straight or curved.

MsoSegmentType can be one of these MsoSegmentType constants.
msoSegmentLine
msoSegmentCurve

Example

This example changes all straight segments to curved segments in the third shape on the active document. The third shape must be a freeform drawing.

Dim lngLoop As Long

With ActiveDocument.Shapes(3).Nodes
    lngLoop = 1
    While lngLoop <= .Count
        If .Item(lngLoop).SegmentType = msoSegmentLine Then
            .SetSegmentType lngLoop, msoSegmentCurve
        End If
        lngLoop = lngLoop + 1
    Wend
End With