S
Steved
Hello from Steved
The Macro finds the next first line By Identifing the
font size 30 and Bold, which is what it does, however
when it reaches the bottom of the document it then
deletes everthing above until it reaches the top of the
document. I goto debug it and it is highlighting
With Selection.Find.Font
Where in the Macro Can I put in telling it when it
reaches the bottom it stops.
Thanks in advance
Sub RaceDictionary2()
Dim i As Long
For i = 1 To ActiveDocument.Paragraphs.Count
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Selection.Find.Execute
End With
Next i
End Sub
The Macro finds the next first line By Identifing the
font size 30 and Bold, which is what it does, however
when it reaches the bottom of the document it then
deletes everthing above until it reaches the top of the
document. I goto debug it and it is highlighting
With Selection.Find.Font
Where in the Macro Can I put in telling it when it
reaches the bottom it stops.
Thanks in advance
Sub RaceDictionary2()
Dim i As Long
For i = 1 To ActiveDocument.Paragraphs.Count
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Selection.Find.Execute
End With
Next i
End Sub