Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Error opening ptm file within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everyone. I'm new to Mappoint and have just added MP routing to an application I am developing. I have ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Error opening ptm file If sPtmFile = "" Then Randomize() iTemp = Int((1000000 * Rnd()) + 1) sPtmFile = Trim(Application.StartupPath) & "\TempMaps\TempMap" & CStr(iTemp) & ".ptm" End If If sOpenWith = "Mappoint" Then oApp.ActiveMap.SaveAs(Filename:=sPtmFile) oApp.ActiveMap.Saved = True oApp.Quit() SysProc.Start("Mappoint.exe", sPtmFile) End If The error occurs when the SysProc funtion attemps to start MP and open the file. I've checked the value of sPtmFile a hundred times and I know it's correct. I can also find the file in Windows Explorer and dblclick it to open it with MP, or open MP and do File->Open on it, so I know there's nothing wrong with the file. Any help you can give me I would appreciate. |
| ||||
|
Is it missing a backslash after TempMap? sPtmFile = Trim(Application.StartupPath) & "\TempMaps\TempMap" & CStr(iTemp) & ".ptm" sPtmFile = Trim(Application.StartupPath) & "\TempMaps\TempMap\" & CStr(iTemp) & ".ptm"
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
| |||
|
Thanks for responding John, but actually "Tempmap" is part of the filename, then I add a random number and the ptm extension. An example is: c:\Program Files\MyApp\TempMaps\TempMap123456.ptm where the "c:\Program Files\MyApp" would be the Application.StartupPath. |
| ||||
|
Why not open mappoint (if not already open) and use the open map method? Here are the samples from the helpfile. Code: 'Assume the MappointControl on your form is named "MappointControl1"
Private Sub Form_Load()
'Assume the file exists in the default directory
MappointControl1.OpenMap "Clients.ptm"
End Sub
Code: Sub OpenSampleMap() Dim objApp As New MapPoint.Application 'Set up application objApp.Visible = True objApp.UserControl = True 'Open a sample map objApp.OpenMap objApp.Path + "\Samples\Clients.ptm" End Sub
__________________ John http://www.support-pc.com Order MapPoint 2006 Here https://secure.mp2kmag.com/?refer=support-PC |
![]() |
| Tags |
| error, file, opening, ptm |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Opening an application from hyperlink of Pushpin | Anonymous | MapPoint 2006/2009 Discussion | 4 | 03-14-2005 05:21 AM |
| Opening a 2000 file | FDPoint | MapPoint 2006/2009 Discussion | 0 | 06-03-2004 06:35 AM |
| Error..cant find file | Anonymous | MapPoint 2006/2009 Discussion | 0 | 05-20-2004 02:18 PM |
| Error on importing shape file | Anonymous | MapPoint 2006/2009 Discussion | 1 | 06-26-2003 10:26 AM |
| Opening a new map takes about 10 sec ?!?!?! | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-25-2002 12:43 PM |