View Single Post

  #4 (permalink)  
Old 11-19-2003
John Meyer's Avatar
John Meyer John Meyer is offline
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
I have not tried it in VBA but I think if you just change the way you declare the var's/setup the app it will work.

Try this.

Code:
Dim objApp As MapPoint.Application
Dim objMap As MapPoint.Map
Dim aPushpin As MapPoint.Pushpin
Dim bPushpin As MapPoint.Pushpin
Dim aShape As MapPoint.Shape
Set objApp = CreateObject("Mappoint.Application")	
Set objMap = objApp.NewMap
    
Set aPushpin = objmap.AddPushpin(objmap.FindResults("New York, NY").Item(1)) 
Set bPushpin = objmap.AddPushpin(objmap.FindResults("Atlanta, GA").Item(1)) 
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location) 
aShape.Line.BeginArrowhead = False 
aShape.Line.EndArrowhead = True 
aShape.Line.Weight = 7 
aShape.Line.ForeColor = vbBlue 


Set aPushpin = objmap.AddPushpin(objmap.FindResults("Chicago, IL").Item(1)) 
Set bPushpin = objmap.AddPushpin(objmap.FindResults("Denver, CO").Item(1)) 
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location) 
aShape.Line.BeginArrowhead = False 
aShape.Line.EndArrowhead = True 
aShape.Line.Weight = 10 
aShape.Line.ForeColor = vbGreen 


Set aPushpin = objmap.AddPushpin(objmap.FindResults("Denver, CO").Item(1)) 
Set bPushpin = objmap.AddPushpin(objmap.FindResults("New York, NY").Item(1)) 
Set aShape = objmap.Shapes.AddLine(aPushpin.Location, bPushpin.Location) 
aShape.Line.BeginArrowhead = False 
aShape.Line.EndArrowhead = True 
aShape.Line.Weight = 2 
aShape.Line.ForeColor = vbRed
__________________
John
http://www.support-pc.com

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