A
ArthurOfAlbion
I recorded a macro as I simultaneously (1) searched for all paragraphs of
outline level 8 and beginning with the text ‘i.’ followed by a tab character
and (2) replaced each instance of the above text with ‘[a]’ followed by a tab
character, and applied various formatting characteristics to each paragraph
found (including outline level 9). I was successful during the recording
process, but the resulting macro doesn’t work. Instead, I am informed that
‘0 replacements were made’. (Of course, I had restored the search target to
the text.) The code, recorded automatically, is as follows:
Sub i__DemotedByJAW()
'
' i__DemotedByJAW Macro
' Macro recorded 11/23/2007 by James Watson
'
Selection.Find.ClearFormatting
With Selection.Find.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.OutlineLevel = wdOutlineLevel8
End With
Selection.Find.ParagraphFormat.Borders.Shadow = False
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.LeftIndent = InchesToPoints(1.75)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.FirstLineIndent = InchesToPoints(0)
.OutlineLevel = wdOutlineLevel9
.CharacterUnitLeftIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
End With
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = "i.^t"
.Replacement.Text = "[a]^t"
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Many thanks in advance for whomever assists me.
James Watson
outline level 8 and beginning with the text ‘i.’ followed by a tab character
and (2) replaced each instance of the above text with ‘[a]’ followed by a tab
character, and applied various formatting characteristics to each paragraph
found (including outline level 9). I was successful during the recording
process, but the resulting macro doesn’t work. Instead, I am informed that
‘0 replacements were made’. (Of course, I had restored the search target to
the text.) The code, recorded automatically, is as follows:
Sub i__DemotedByJAW()
'
' i__DemotedByJAW Macro
' Macro recorded 11/23/2007 by James Watson
'
Selection.Find.ClearFormatting
With Selection.Find.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.OutlineLevel = wdOutlineLevel8
End With
Selection.Find.ParagraphFormat.Borders.Shadow = False
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.LeftIndent = InchesToPoints(1.75)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.FirstLineIndent = InchesToPoints(0)
.OutlineLevel = wdOutlineLevel9
.CharacterUnitLeftIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
End With
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = "i.^t"
.Replacement.Text = "[a]^t"
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Many thanks in advance for whomever assists me.
James Watson