How to determine territory of a recently placed pushpin ?
I know how to place pushpins and play with latitude/longitude and everything, but I am so far unable to determine the territory name for a pushpin I just placed (using VBA).
I have about 50 territories in the united states and would like to place a pushpin, determine it's territory and delete the pushpin.
Determining the territory is my issue. I tried doing a search but all of those who have posted this question did not get any answer. I hope i'll be more successful !
Thank you for your help it will be greatly appreciated.
Sonicman
Could this be adapted to work ?
Here is some code posted by a guest on another topic. Does anyone think it could be adapted to find the territory of a pushpin ?
Quote:
Here is the code to read the linked Territory. I was wondering if some body has dome the same but with Manually created Territory
With objMap.DataSets
szconn = objMap.Path & "C:\MapPoint\pushpin\Terrs.xls!Sheet1!A1:E127"
Set mpDataSet = .ImportTerritories(szconn, , geoCountryUnitedStates, , geoImportExcelA1)
End With
Dim objRecordset As Recordset
Set objRecordset = mpDataSet.QueryAllRecords
Dim strLookUp As String
ReDim Preserve strRegion(0)
x = 0
'Get the values
Dim vals As String
objRecordset.MoveFirst
Dim i As Integer
Do Until objRecordset.EOF
strLookUp = Trim(objRecordset.fields("Territory"))
ReDim Preserve strRegion(x)
strRegion(x) = strLookUp // I have the list here...
x = x + 1
End If
objRecordset.MoveNext
Loop
Still no solution after two weeks
After two weeks of searching and posting I still haven't found a solution to this problem. I decided to reply to my own post again to make it sticky.
Maybe someone will find a solution and share it ?
Alex