how can I get the lines which are have selected text in them?
For example:

The selected lines would be 1, 2,3 and 4 (0 being the first line)
How can I get to code like:
For Each line as string(or integer) in textbox1."SelectedLines"
'Do something here for each line
Next
Thanks
Taking you literally, you need to find the line numbers, even though only parts of line 1 and 4 are selected. Do that as follows: