spliting paragraphs after n words
i have a document with many paragraphs. all formated like:
T: ...
P: ...
T: ...
fist i delete all paragraphs with T: at the beginning with a macro that delete text between two words:
------------------------------------
Sub DeleteTextBetweenTwoWords()
Dim strFirstWord As String
Dim strLastWord As String
Dim objDoc As Document
Dim objWord As Object
Set objDoc = ActiveDocument
strFirstWord = "T:"
strLastWord = "P:"
With Selection
.HomeKey Unit:=wdStory
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = strFirstWord & "*" & strLastWord
.Replacement.Text = strLastWord
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End With
Set objDoc = Nothing
Set objWord = Nothing
End Sub
------------------------------------------
the result is that i only get the paragraphs with P: at the beginning.
how can i split now the remaining paragraphs after, for example, 50 words?
|