I realize VBA does not like #s hence I’m struggling with this code.
Do
'Find the next sentence starting at the end of the last sentence
Selection.Find.Text = "[^13.\?\!]{1}[!.\?\!^13]@[.\!\?]{1}"
Selection.Find.Execute
OldValue = Selection.Start 'This is for loop control
'Remove the punctuation at the beginning of the sentence (that was from the last sentence
Selection.Find.Text = "<*>*[.\!\?]{1}"
Selection.Find.Execute
If InStr(1, Selection.Text, FindWord, vbTextCompare) > 0 Then
'save the sentence
End if
Selection.Collapse wdCollapseEnd
Selection.MoveLeft wdCharacter, 1, False
Loop While BreakLoop
My problem is that the first execute gets all screwy when it hits a sentence with a # in it. and Selection.Start becomes 0 (anytime it hits a sentence that has a # in it).
Any ideas? I’m thinking of putting it up on stackoverflow.