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
Why don't you modify the style? -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Steve" wrote in message news:B46E6BC0-15E3-463E-BBE7-B5F96F9F1DFC@microsoft.com... > 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 > > >
Thanks - looks like its time for me to learn about styles.