|
Hi vidyakulkarni,
The method to use is AddPolyline.. it takes an array of locations as a parameter.
Here's the example from the Help file:
Sub AddPolylineToMap()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc(1 To 3) As MapPoint.Location
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
'Get three locations and zoom in
Set objLoc(1) = objMap.FindResults("Seattle, WA").Item(1)
Set objLoc(2) = objMap.FindResults("Redmond, WA").Item(1)
Set objLoc(3) = objMap.FindResults("Tacoma, WA").Item(1)
Set objMap.Location = objLoc(1)
'Create a polyline by connecting these locations
objMap.Shapes.AddPolyline objLoc
End Sub |