MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Selecting Shape Based on Name

This is a discussion on Selecting Shape Based on Name within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have some code where I want to select a shape based on its name Dim objShape As MapPoint.Shape Dim ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-03-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Selecting Shape Based on Name

I have some code where I want to select a shape based on its name

Dim objShape As MapPoint.Shape
Dim strName As String

strName = "NA123456"

objShape = objMap.Shapes.Item(strName)

Basically something like that, however everytime I run it I get the rather irratating Mappoint has encountered a problem and needs to close window.

If I do

objShape = objMap.Shapes.Item(1)

It works fine

The help files clearly state that you can select a shape based on its name, and all the shapes have been named properly.

Has anyone else encountered a similar problem or has any ideas as to what i'm doing wrong
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-07-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Not all shapes have a name property (like a geoline for example). Here is a basic sample that might help. Create a shape (Rectangle,Oval or Circle) and name it "MyShape"

Code:
Dim objshape As MapPoint.Shape
    For Each objshape In MappointControl1.ActiveMap.Shapes
        
        Select Case objshape.Type
            Case 1 ' An AutoShapeType (Rectangle,Oval or Circle)
                If objshape.Name = "MyShape" Then
                    MsgBox "Do Something"
                End If
        End Select
    Next
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
based, selecting, shape


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Does an object reside in my Shape or Shape boundaries? hotrdd MapPoint 2006/2009 Discussion 1 08-04-2005 09:51 PM
Selecting and deleting the push pin Anonymous MapPoint 2006/2009 Discussion 1 02-10-2005 07:01 AM
Selecting cities in drivetime Anonymous MapPoint 2006/2009 Discussion 5 02-02-2005 04:21 PM
Selecting a prviously drawn shape CSG MapPoint 2006/2009 Discussion 1 03-24-2004 10:08 AM
Selecting pushpins within a shape Anonymous MapPoint 2006/2009 Discussion 1 09-26-2002 08:11 AM


All times are GMT -5. The time now is 06:34 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Flights from East Midlands Airport
Book low cost airline flights from East Midlands Airport. Holiday Hypermarket let you search for great deals from top tour operators.

Turkey Holidays
Find great Turkey Holidays with Travel Counsellors. A personal Travel Counsellor can help you plan the perfect holiday to Turkey.

Holiday Cuba
Most of all though, you will remember your Holiday in Cuba for the people. Naturally open and friendly with the warmest welcome in the Caribbean. Book at dealchecker.co.uk today.

All Inclusive Maldives
Visit The Holiday Place.co.uk for great deals on all inclusive holidays to the Maldives. Book a holiday to the outstandingly beautiful Maldives.

Cheap Balearics Holidays
Cheap Balearics holidays are available if you know when to book and who to book with. The Balearics have many fascinating places to visit all year round. The partying never stops.

Bargain family holidays
We can help you find family holidays at bargain prices when you check out the options at Travel.co.uk

Holidays to Sharm el Sheikh
Want to visit the Sinai peninsula? We can help. Info on holidays to Sharm el Sheikh, only at On The Beach.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52