Dim n as Integer
n = Instr(mainString, "stringtomatch")
Thank you Simon it worked.
There is a more robust way to get the type of a feature, namely IFeature.GetTypeName2 . If you use that, you won't have problems with custom feature names and language variations.
If you still want to find a substring (I assume you use VBA), here's a page with some examples:
For that you can use API.
GetTypeName Method (IFeature) To find the Feature types.
Now I want to access listbox control using an index :
I tried ListBox1(3).Text
is there any property which will help me to access in this way?
These sound like basic questions to me, so I should advice you to search Google and/or the forums for it first. Just searching for basic VBA tutorials and you will find a treasure trove of answers.
Now what are you really trying to do? Do you want to access the third item in the list? You can get all of the items in the list using ListBox1.Items, this will return a two-dimensional array with the list contents. You can then do something like this:
Dim i As Integer
Dim obj As Variant
obj = UserForm1.ListBox1.List
For i = 0 To 1
Debug.Print obj(i, 0)
Note: I didn't know this as well, just searched for it and tried something
Great..thank you Peter.