Delete method
Deletes the specified collection or object from the map.
Applies to
Collections: SavedWebPages
Objects: DataSet, Pushpin, SavedWebPage, Shape, Symbol, Waypoint
Syntax
object.Delete
Parameters
Part |
Description |
---|---|
object |
Required. An expression that returns a collection or object from the Applies to list. |
Remarks
If the deleted Symbol object is currently in use by a Pushpin, the Symbol property for that Pushpin or DataSet object changes to 0 (a black Pushpin).
Returns an error for objects that may not be deleted, such as the MapPoint standard symbols.
Example
Sub DeleteWaypoint()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objRoute As MapPoint.Route
'Set up the application
Set objMap = objApp.ActiveMap
Set objRoute = objMap.ActiveRoute
objApp.Visible = True
objApp.UserControl = True
'Add two waypoints
objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
'Delete the second waypoint
objRoute.Waypoints.Item(2).Delete
End Sub
Note This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.