Copy method
Copies the specified object to the Clipboard, as follows:
Object | What is copied |
---|---|
DataSet | The data set to paste to the map, or an image of the data set legend or the location of each data point to paste in another application |
Location | The location name to paste in another application |
Pushpin | The Pushpin to paste to the map, or the Pushpin name to paste to another application |
SelectedArea | An image of the selected area to paste to another application |
Shape | The shape to paste to the map |
Waypoint | The waypoint to paste to the map, or the waypoint location to paste to another application |
Applies to
Objects: DataSet, Location, Pushpin, SelectedArea, Shape, Waypoint
Syntax
object.Copy
Parameters
Part | Description |
---|---|
object | Required. An expression that returns an object from the Applies to list. |
Remarks
To copy a Map object, use the CopyMap method on the Map object.
To copy a Directions collection, use the CopyDirections method on the Map object.
To paste the contents of the Clipboard, use the Paste method on a Map or DataSet 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