ShapeNodes.SetSegmentType Method (Publisher)

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

Syntax

expression. SetSegmentType(Index, SegmentType)

expression A variable that represents a ShapeNodes object.

Parameters

Name Required/Optional Data Type Description
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.

Remarks

The SegmentType parameter can be one of the MsoSegmentType constants declared in the Microsoft Office type library and shown in the following table.

msoSegmentCurve

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