View Single Post

  #4 (permalink)  
Old 01-10-2003
stiemark stiemark is offline
Junior Member
White Belt
 
Join Date: Dec 2002
Posts: 4
If this is going to be used by other people, you also want to trap the case where there is no selection. If you don't do that, the program will error when you try to ask the typeof nothing.
Try this:
Code:
Dim objmap As MapPointctl.Map 
Dim objPushpin As MapPointCtl.Pushpin 

Set objmap = MapPointControl1.ActiveMap 

'Make sure the item selected on the map is a pushpin 
If Not objmap.Selection is nothing Then
  If TypeOf objmap.Selection Is Pushpin Then 
    Set objPushpin = MapPointControl1.Selection        
    'Do Something 
    msgbox objpushpin.name 
  End If
End If
Reply With Quote