View Single Post
 
Old 09-12-2015, 07:59 PM
DougMVP DougMVP is offline Windows 7 32bit Office 2010 32bit
Advanced Beginner
 
Join Date: Nov 2013
Posts: 50
DougMVP will become famous soon enough
Default

Is there an empty paragraph in the space between the e. paragraph and the following text?

Also, do you want the Red line as well as the text "Ans."

If there is an empty paragraph in the space, the following should do what you want:

Code:
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
    Do While .Execute(FindText:="^p^p", MatchWildcards:=False, Forward:=True, Wrap:=wdFindStop) = True
        With Selection
            .Collapse wdCollapseEnd
            With .Borders(wdBorderTop)
                .LineStyle = wdLineStyleSingle
                .LineWidth = wdLineWidth450pt
                .Color = wdColorRed
            End With
            .InsertBefore "Ans." & vbCr
            .Collapse wdCollapseEnd
        End With
    Loop
End With
Reply With Quote