Share via


Paste method

Pastes the contents of the Clipboard as follows: a Pushpin or Pushpin set to the specified DataSet object, or the data set, shape, or waypoint to the specified Map object. The Paste method is similar to choosing Paste on the Edit menu when the focus is on the map, or on the Set Properties dialog box for the data set. Returns an error if the type of data or schema is invalid. Returns a Boolean for a data set.

Applies to

Objects:  DataSet, Map

Syntax

object.Paste

Part Description
object Required. An expression that returns a DataSet or Map object.

Example

    Sub CopyAndPasteShape()

  Dim objApp As New MapPoint.Application   Dim objMap As MapPoint.Map   Dim objLoc As MapPoint.Location   Dim objShape As MapPoint.Shape
  'Set up application and get a location object   Set objMap = objApp.ActiveMap   objApp.Visible = True   objApp.UserControl = True   Set objLoc = objApp.ActiveMap.GetLocation(0, 0)
  'Create a shape   Set objShape = objMap.Shapes.AddShape(geoShapeRectangle, objLoc, 20, 30)
  'Copy the shape, paste it, and verify there are now two shapes   objShape.Copy   objMap.Paste   MsgBox "Now there are " + CStr(objMap.Shapes.Count) + " shapes on the map."
  End Sub