Select from cursor postion to end of sentence

B

BillW

Greetings:
I am using Word 2007 on Windows XP SP3. I can find many examples of code
that will select the current sentence, or the sentence after the current
sentence, or even select the current sentence and then add to the selection
the next sentence down the line with each press of the macro shortcut keys.

What I would like to do is create a macro that will select from the cursor
to the end of the current sentence, or at least to the next punctuation mark,
with the ability to continue adding to the selection using the punctuation as
the marking points.

Any help or direction greatly appreciated.
 
D

DaveLett

Hi BillW,
You can use the following to select from the current select to the end of
the sentence (determined by MS Word):

Dim oRng As Range

Set oRng = Selection.Range
oRng.End = Selection.Sentences(1).End

oRng.Select

HTH,
Dave
 
B

BillW

Thanks, Dave, that covers the main goal I had in posting. Had no idea it
would be this simple. I tend to overcomplicate things. Thanks for setting me
straight!

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top