SetSegmentType Method

Microsoft Publisher Visual Basic

expression.SetSegmentType(Index, SegmentType)

expression    Required. An expression that returns one of the objects in the Applies To list.

Index   Required Long. The node whose segment type is to be set. Must be a number from 1 to the number of nodes in the specified shape; otherwise, an error occurs.

SegmentType   Required MsoSegmentType. Specifies the segment type.

MsoSegmentType can be one of these MsoSegmentType constants.
msoSegmentCurve
msoSegmentLine

Example

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

Dim intCount As Integer

With ActiveDocument.Pages(1).Shapes(3).Nodes
    intCount = 1
    Do While intCount <= .Count
        If .Item(intCount).SegmentType = msoSegmentLine Then
            .SetSegmentType _
                Index:=intCount, SegmentType:=msoSegmentCurve
        End If
        intCount = intCount + 1
    Loop
End With