Hey all,
How do you just select the active sentence in a word document using VBA? I see the document.sentences.item(???).select method. But how do I know my item number?
Just selecting the sentence with the insertion point in it:
If Selection.Type = wdSelectionIP Then
Selection.Sentences(1).Select
End If
Caveat: Word's idea of a sentence includes the spaces between this sentence and the next. This may be more than one, or something you do not want at all. Also, if the sentence is the last sentence of a paragraph, the paragraph mark will be included in the selection plus any following "empty" paragraph marks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.