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. Can be one of the MsoSegmentType constants declared in the Microsoft Office type library.

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 

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.