Share via


MoveTo method

Moves a Pushpin to another data set. Returns an error if the DataMapType property of the data set is not geoDataMapTypePushpin.

Applies to

Objects:  Pushpin

Syntax

object.MoveTo(NewDataSet)

Parameters

Part Description
object Required. An expression that returns a Pushpin object.
NewDataSet Required DataSet object. Data set to which the Pushpin should be moved.

Example

    Sub MovePushpinToAnotherSet()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map   Dim objPin As MapPoint.Pushpin
  'Set up the application   Set objMap = objApp.ActiveMap   objApp.Visible = True   objApp.UserControl = True
  'Add a Pushpin to the map and create a new data set   Set objPin = objMap.AddPushpin(objMap.FindResults("Seattle, WA")(1))   objMap.DataSets.AddPushpinSet "New Set"   objPin.MoveTo objMap.DataSets.Item("New Set")
  End Sub

Note  This sample code is specifically for use in MapPoint North America; it is for illustration purposes only.