Hi Greg,
Yes, I do realise Word's Sentences collection is, shall we say, brain dead (why can't MS employ the sentence logic from it's own grammar checker to inform vba of what a sentence is??).
All the same, a response like 'I can't get it to work' is, as I said, "not exactly descriptive".
I'm not sure that your code will fare any better, as it works at the paragraph level only. So, if the second sentence starts with "<start level = "4">", it won't get processed; and a multi-sentence paragraph that starts with "<start level = "4">" will get the closing tag at the end of the paragraph instead of at the end of the first sentence.
I guess we'll need to wait till the OP says what the issue is.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|