Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping locations with MapPoint 2004

Status
Not open for further replies.

davem99

Programmer
May 19, 2003
74
US
does anyone have any VB 6.0 code that hooks into MapPoint and show multiple addresses?

Thanks!!
 
Just found this bit as well:

Sub ImportFromMultipleSources()

Dim mpApp As MapPoint.Application
Dim mpDatasets As MapPoint.DataSets
Dim mpDataSet As MapPoint.DataSet
Dim myExampleArray(4, 2)

'Start MapPoint
Set mpApp = New MapPoint.Application
mpApp.Visible = True
mpApp.UserControl = True

'Get the DataSets collection
Set mpDatasets = mpApp.NewMap.DataSets

'Create the ArrayOfFields descriptions

'Field is specified by name
myExampleArray(1, 1) = "Latitude"
'tells MapPoint to use this field as the latitude field
myExampleArray(1, 2) = geoFieldLatitude

'Field again specifed by name
myExampleArray(2, 1) = "Longitude"
'tells MapPoint to use this field as the longitude field
myExampleArray(2, 2) = geoFieldLongitude

'Field is listed by index, rather than name
myExampleArray(3, 1) = 1
'tells MapPoint to use this field as additional (non geocoding) information
myExampleArray(3, 2) = geoFieldData

'Field is specified by source name
myExampleArray(4, 1) = "ExDat"
'New field name after import--when changing the name,
'MapPoint assumes that the type is geoFieldData
myExampleArray(4, 2) = "ExampleData"

'Perform the import
Set mpDataSet = mpDatasets.ImportData("c:\foo.xls!Sheet1!A1:B4", myExampleArray)

'The (x,2) elements are of the type GeoFieldType or string.
'If string, then they set the new name of the field, and
'MapPoint assumes that the field is a nongeocoding data field.

End Sub

Good luck

BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top