Sub Demo()
Application.ScreenUpdating = False
Dim SrcDoc As Document, DestDoc As Document
Set SrcDoc = ActiveDocument: Set DestDoc = Documents.Add
With SrcDoc.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "[A-Z][A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
End With
Do While .Find.Execute
With .Words.First
If .Start <> .Sentences.First.Start Then
DestDoc.Range.Characters.Last.FormattedText = .FormattedText
DestDoc.Range.InsertAfter vbCr
End If
End With
.Collapse wdCollapseEnd
Loop
End With
Application.ScreenUpdating = True
End Sub
I have no idea what you mean by that.still picking up sentence starts before tabs.
Yes, but the code would need re-writing. Best if you provide more detail about the first issue before I do that.Also is it possible to only include a unique word in the list once?
Sub Demo()
Application.ScreenUpdating = False
Dim SrcDoc As Document, DestDoc As Document, StrFnd As String, StrOut As String
Set SrcDoc = ActiveDocument: Set DestDoc = Documents.Add: StrOut = " "
With SrcDoc.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<[A-Z][A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
End With
Do While .Find.Execute
StrFnd = .Text & " "
With .Words.First
If .Start <> .Sentences.First.Start Then
If InStr(StrOut, " " & StrFnd) = 0 Then StrOut = StrOut & StrFnd
End If
End With
.Collapse wdCollapseEnd
Loop
End With
DestDoc.Range.Text = Replace(Trim(StrOut), " ", vbCr)
Application.ScreenUpdating = True
End Sub