Hi,
I have an opened WORD doc with unknown number of
paragraphs. How can I select the first line of
each paragraph?
Thank you
Printable View
Hi,
I have an opened WORD doc with unknown number of
paragraphs. How can I select the first line of
each paragraph?
Thank you
I can get you part way there. This code will find the first three left-justified paragraphs
wdApp.Selection.Find.ClearFormatting
wdApp.Selection.Find.ParagraphFormat.Alignment = wdAlignParagraphLeft
With wdApp.Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
wdApp.Selection.Find.Execute
wdApp.Selection.Find.Execute
wdApp.Selection.Find.Execute