View Single Post

  #7 (permalink)  
Old 10-29-2004
John Meyer's Avatar
John Meyer John Meyer is offline
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Ok, Let me know if this works for you.

Visual Basic 6
Assumes you have the CalcPos Sub and the Function Arccos by Author Gilles Kohl in you project. http://www.mp2kmag.com/articles.asp?ArticleID=13
References: Microsoft MapPoint 11.0 Object Library(North America)
MapPointControl.ocx is on Form1
One Command Button (Command1)


Code:
Public ilat As Double
Public ilon As Double

Private Sub Form_Load()
Dim objmap As MapPointctl.Map
Set objmap = MappointControl1.NewMap(geoMapNorthAmerica)
End Sub


Private Sub Command1_Click()
Dim objmap As MapPointctl.Map
Set objmap = MappointControl1.ActiveMap
Dim objLoc As MapPointctl.Location
Dim objPushpin As MapPointctl.Pushpin
Set objLoc = objmap.FindResults("Seattle, WA")(1)
Set objPushpin = objmap.AddPushpin(objLoc, "My Test Pushpin")
CalcPos objmap, objPushpin.Location, ilat, ilon
MsgBox ilat & ", " & ilon
End Sub
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Reply With Quote