S
Steve
I'm trying to replace all level 2 text with the formattting of 0.2 indent
paragraphing.
It works as a dummy run (ie without pressing macro record) but nothing
happens when recorded and run as a macro. Help!
Here's the macro
Sub outlinerO()
'
' outlinerO Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 2")
With Selection.Find.ParagraphFormat
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorBlack
.BackgroundPatternColor = wdColorBlack
End With
.Borders.Shadow = False
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.LeftIndent = CentimetersToPoints(0.2)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.CharacterUnitLeftIndent = 0
.WordWrap = True
End With
With Selection.Find.Replacement.ParagraphFormat
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorBlack
.BackgroundPatternColor = wdColorBlack
End With
.Borders.Shadow = False
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.CorrectHangulEndings = False
.HanjaPhoneticHangul = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
paragraphing.
It works as a dummy run (ie without pressing macro record) but nothing
happens when recorded and run as a macro. Help!
Here's the macro
Sub outlinerO()
'
' outlinerO Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 2")
With Selection.Find.ParagraphFormat
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorBlack
.BackgroundPatternColor = wdColorBlack
End With
.Borders.Shadow = False
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.LeftIndent = CentimetersToPoints(0.2)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.CharacterUnitLeftIndent = 0
.WordWrap = True
End With
With Selection.Find.Replacement.ParagraphFormat
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorBlack
.BackgroundPatternColor = wdColorBlack
End With
.Borders.Shadow = False
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.CorrectHangulEndings = False
.HanjaPhoneticHangul = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub