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

ShapeNodes.SetSegmentType Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

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.


expression. SetSegmentType( Index, SegmentType)

_expression_A variable that represents a ShapeNodes object.


NameRequired/OptionalData TypeDescription
IndexRequiredLongThe 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.
SegmentTypeRequiredMsoSegmentTypeSpecifies the segment type.


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

| msoSegmentCurve| | msoSegmentLine|


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 
End With 
© 2018 Microsoft