balavaka,
Your sample document does not reflect your stated objective. Your statement below:
"If a paragraph starts with <S1> and the next paragraph is starts with <S2> in the to change them to <S1-S2>."
Example:
<S1> AAA
<S2> BBB
Meets your conditions. Change "them" would imply:
Would be:
<S1-S2>
<S1-S2>
What exactly are you trying to achieve? What is the condition requiring change and what do you want changed.
BREAK
Vivka, why do you prefer working with the selection object?
|