S
Steve Lowe
Hi,
I've put together the following code, but how do I make it repeat
until it reaches the end of the document
Regards
Splowe.
Sub ParFindandFormat()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Paragraph"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
'Make this line bold and underline
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = wdToggle
If Selection.Font.Underline = wdUnderlineNone Then
Selection.Font.Underline = wdUnderlineSingle
Else
Selection.Font.Underline = wdUnderlineNone
End If
'Go to end of line
Selection.EndKey Unit:=wdLine
'Insert a blank line
Selection.TypeParagraph
End If
End Sub
- Steve Lowe
- E-Mail : (e-mail address removed)
- Before Replying Remove .NO.SPAM
- UK Resident although my e-mail address is usa.net
I've put together the following code, but how do I make it repeat
until it reaches the end of the document
Regards
Splowe.
Sub ParFindandFormat()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Paragraph"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
'Make this line bold and underline
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Bold = wdToggle
If Selection.Font.Underline = wdUnderlineNone Then
Selection.Font.Underline = wdUnderlineSingle
Else
Selection.Font.Underline = wdUnderlineNone
End If
'Go to end of line
Selection.EndKey Unit:=wdLine
'Insert a blank line
Selection.TypeParagraph
End If
End Sub
- Steve Lowe
- E-Mail : (e-mail address removed)
- Before Replying Remove .NO.SPAM
- UK Resident although my e-mail address is usa.net