Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Use CalcPos on a map with EXISTING pushpins ?? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Is it possible to get the Location object of pushpins already on a map? Let's say I have 3500 Pushpins ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Use CalcPos on a map with EXISTING pushpins ?? Let's say I have 3500 Pushpins saved on a file... I would like to get the Lat/Lon of those using the CalcPos routine (VBA)... I have used the calcpos already with success (right after creating a pishpin), I just don't know how to get the location object of pushpins already present on a map... Thanks all in advance for your support! Sonicman |
| |||
|
Hi, This gets all pushpins on the map and their Location object: Code: object o = 1;
MapPoint.DataSet ds = mp.ActiveMap.DataSets.get_Item(ref o);
Recordset rs = ds.QueryAllRecords();
rs.MoveFirst();
while (!rs.EOF) {
Location loc = rs.Pushpin.Location;
rs.MoveNext();
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Thanks....
Hi, Quote:
Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Ok I have successfully translated you code
Here's the working code in VB format for those interested (the following displays a msgbox for each pushpin name on a current map): Code: Private Sub Commande0_Click()
Dim objApp As MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location
Dim objRecordSet As MapPoint.Recordset
Dim objDataset As MapPoint.DataSet
Set objApp = GetObject(, "Mappoint.Application.NA")
Set objMap = objApp.ActiveMap
Set objDataset = objMap.DataSets.Item(1)
Set objRecordSet = objDataset.QueryAllRecords
objApp.Visible = True
objApp.UserControl = True
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
Set objLoc = objRecordSet.Pushpin.Location
objRecordSet.MoveNext
MsgBox objLoc.Name
Loop
End Sub
Sonicman |
| |||
|
Hi, I appreciate also your feedback. It will benefit lots of othr user. Glad your solution works
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| calcpos, existing, map, pushpins |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Some concerns about calcpos sub | lucci56 | MapPoint 2006/2009 Discussion | 5 | 07-18-2006 10:44 AM |
| Problems using CalcPos | Pete_ADL | MapPoint 2006/2009 Discussion | 4 | 06-21-2006 03:12 PM |
| Looking for existing app to meet needs | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-01-2004 11:44 AM |
| Confused with calcpos :s | Matrices | MapPoint 2006/2009 Discussion | 4 | 09-25-2003 09:30 AM |
| Is it possible to add a new point to an existing p.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-17-2001 01:38 AM |
Antalya Holiday
Check out the Antalya holiday options through UlookUbook and find amazing offers that suit your pocket...