Community of VE/MapPoint Users and Developers
This is a discussion on VBA calling MP2k2 within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am trying to give the ability to my user to look up a record in an access form, click ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| VBA calling MP2k2 Is there a peice of code that will just add a new pin to the current map. How might I referance the original windows/object I am not using datasets because I done know what records the user might choose. Thanks in advance, Roger Here is my code that will run every time the user switches to a new record clicks the map button on the form. **************Code************************* Dim MPApp As MapPoint.Application Set MPApp = CreateObject("MapPoint.Application") Set omap = GetObject(, "MapPoint.Application").ActiveMap Dim oLoc As MapPoint.Location Dim oPin As MapPoint.Pushpin Dim StreetAdr As String StreetAdr = Me.delivDayAddress + "," + Me.delivDayZip omap.FindResults(StreetAdr)(1).Goto Set oLoc = omap.FindAddressResults(Me.delivDayAddress, , , , Me.delivDayZip)(1) Set oPin = omap.AddPushpin(oLoc) oPin.Name = [Forms]![LogCustomer]![FirstName] & " " & [Forms]![LogCustomer]![LastName] oPin.BalloonState = geoDisplayBalloon oPin.Note = Me.delivDayPhone oPin.Symbol = 25 MPApp.WindowState = geoWindowStateMaximize MPApp.UserControl = True MPApp.ActiveMap.Saved = True MPApp.Visible = True |
| ||||
|
Roger, On the first go around, MapPoint is not running yet so this part of your code is needed Set MPApp = CreateObject("MapPoint.Application") If MapPoint is running already this line of code starts another copy.
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| calling, mp2k2, vba |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling all Micro-ISVs! | Winwaed | General Chat | 2 | 05-05-2006 12:16 PM |
| AGPS in MP2k2 shows wrong long/lat but yet plots correct pos | Jamez_Warner | MapPoint 2006/2009 Discussion | 1 | 06-17-2003 10:18 AM |
| 911 outbound calling | LLurie | MapPoint 2006/2009 Discussion | 4 | 04-21-2003 10:41 AM |
| mp2k2 Fleet Applications | Clyde | MapPoint 2006/2009 Discussion | 2 | 01-11-2003 09:48 PM |
| I wonder if there is a way to import MP2k2 data in.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-20-2001 08:34 AM |