PDA

View Full Version : newbie needs sample VB6 code to insert pins from post codes



microman
05-30-2008, 01:29 PM
Hi,

I bougt MapPoint 2004 when it came out and we have used it manually ever since.

:boat:

Now we need to write a program to use it, a new adventure dawns....... and I am all at sea with teh placing of pins.

I am hoping that one of you kind souls will post some sample code that shows me how to stick a pin on the map at a post code (UK Zip Codes) and I can do the rest from there.

I have the map on screen in my VB6 form, and I can make pins appear from a lat & Long but I need to run through a recordset, placing coloured pins depending on the type of location and I can't see how to insert a pin at apost code.

Thanks is advance,

Microman

microman
05-30-2008, 05:32 PM
I found a sample in the programming section, but just in case anyone else needs a pointer, this is how I resolved it.

Now I just need different pins for different types of premises etc etc.


Set evdb = OpenDatabase("C:\ops97.mdb")
Set evrs = evdb.OpenRecordset("ops")
Set objMap = mpc.NewMap(geoMapEurope)
objLoc.GoTo
mpc.ActiveMap.Altitude = 300
On Error Resume Next 'this is to jump unknown post codes
Do Until evrs.EOF
Set objPin = objMap.AddPushpin(objMap.FindResults(evrs("pcode"))(1))
evrs.MoveNext
DoEvents
Loop