示例:由点的集合构成Path,由Path生成Polyline
Dim fromPoint As IPoint , toPoint As Ipoint
Dim pPathA As IPath, pPathB As IPath
Dim pPolyline As ISegmentCollection
'Use the ISegmentCollection Interface on Polyline
Set fromPoint = New Point
Set toPoint = New Point
fromPoint.X = 20
fromPoint.Y = 30
toPoint.X = 450
toPoint.Y = 55
Set pPathA = New Path
'Path inherits the ICurve interface
pPathA.FromPoint = fromPoint
pPathB.ToPoint = toPoint
fromPoint.X = 450
fromPoint.Y = 55
toPoint.X = 456
toPoint.Y = 330
Set pPathB = New Path
pPathB.FromPoint = fromPoint
pPathB.ToPoint = toPoint