C
Co
Hi All,
I need to cut a word doc that consists of several parts into smaller
documents.
The doc starts with SUBJECT and then some text, a new part again
starts with SUBJECT.
So I'm trying to search for the word SUBJECT and then highlight all
the text after that until
it finds SUBJECT again. The highlighted text must be copied into a new
document.
I managed to find the word SUBJECT but then I need to know how many
lines until the next
SUBJECT. Can that be done?
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 16
With Selection.Find
.Text = "SUBJECT"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveDown Unit:=wdLine, Count:=15, Extend:=wdExtend
Marco
I need to cut a word doc that consists of several parts into smaller
documents.
The doc starts with SUBJECT and then some text, a new part again
starts with SUBJECT.
So I'm trying to search for the word SUBJECT and then highlight all
the text after that until
it finds SUBJECT again. The highlighted text must be copied into a new
document.
I managed to find the word SUBJECT but then I need to know how many
lines until the next
SUBJECT. Can that be done?
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 16
With Selection.Find
.Text = "SUBJECT"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveDown Unit:=wdLine, Count:=15, Extend:=wdExtend
Marco