Ideally, I want to "select" the "sentence" of the selected text - this will work without needing to modify any other code.
So the below line works fine, EXCEPT when the text is in a table and also the last row - as it picks up end of row characters.
Code:
sStringVariable = oWordApp.Selection.Sentences(1)
@gmayor's code - it doesn't appear to work correctly, in that it doesn't detect if the cell is in the last row.
So, all I need to do is detect if the selection is in the last row of a table, and then strip off the last 2 chars.
Quote:
Originally Posted by vivka
hss001, do you want the code to msgbox, select or highlite the found sentence(s)? If the found senetence is selected the original selection will be always broken. Sorry, but I don't quite understand your aim.
|