Print a map

zanabonir
02-27-2008, 12:21 PM
Dear Forum

i use VB6 whit mappoint ocx. I created a form that include a map.
I can add pushpin and many other thinks. Now i want print the current
map view, but dont work ( i used the ....ActiveMap.PrintOut method)

Can you help me ?

thanks

roberto

Mattys Consulting
02-27-2008, 12:57 PM
Hi zanabonir,

Please post the code you used for the print routine
so that one of us might identify the problem.

Thanks,

Mike Mattys

zanabonir
02-29-2008, 07:56 AM
Thanks MR Matthis

i display a map in my form1 .

The map abject i have so :

MapObj=form1.mpc.ActiveMap

for print, i do this:

MapObj.PrintOut

but is not working. I belive i need some other set befor i can use this commend

Thanks

Mattys Consulting
02-29-2008, 09:37 AM
zanabonir, I am making a demo in VB6
I hope this helps you ...

Mike Mattys

Form1 Code
------------------------------------------------------------
Option Explicit

Private objMap As MapPointCtl.Map

Private Sub Form_Load()
Form1.MappointControl1.Object.NewMap geoMapNorthAmerica
Set objMap = Form1.MappointControl1.Object.ActiveMap
End Sub

Private Sub Form_Unload(Cancel As Integer)
objMap.Saved = True
Set objMap = Nothing
End Sub

Private Sub Command1_Click()
PrintTurnByTurnRoute
End Sub

Sub PrintTurnByTurnRoute()
Dim objRoute As MapPointCtl.Route

'Set up the application
Set objRoute = objMap.ActiveRoute

'Create a route
objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
objRoute.Waypoints.Add objMap.FindResults("Spokane, WA").Item(1)
objRoute.Calculate

'Print 2 draft copies of the route turn-by-turn with an Overview Map
objMap.PrintOut , "Turn-by-turn route", 2, _
geoPrintTurnByTurn, geoPrintQualityDraft, geoPrintLandscape, _
True, False, True, False
Set objRoute = Nothing
End Sub

zanabonir
02-29-2008, 03:18 PM
Thanks MR Matthis

problem solved. But please, explain to me one thik

Why you wrote

Set objMap = Form1.MappointControl1.Object.ActiveMap

and not
Set objMap = Form1.MappointControl1.ActiveMap

Also VB cant show me any suggestion after Object.

Thanks

 
Web mp2kmag.com
mapforums.com