slf221
07-07-2006, 09:28 AM
Hi,
I'm working in Word 2003, doing a find and replace to change all tabs to indents. Every time I run the macro, all modified paragraphs end up with borders and the border specifications appear in the replace dialog box. Any idea why this is or how to fix it? Here's my macro:
test2 Macro
' Macro recorded 7/6/2006 by MCSD
'
ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View. _
ShowAll
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceDouble
.Alignment = wdAlignParagraphLeft
.FirstLineIndent = InchesToPoints(0.5)
.CharacterUnitFirstLineIndent = 0
End With
Selection.Find.Replacement.ParagraphFormat.TabStops.ClearAll
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = "^t"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.HomeKey Unit:=wdStory
End Sub
Any help would be GREATLY appreciated!!
I'm working in Word 2003, doing a find and replace to change all tabs to indents. Every time I run the macro, all modified paragraphs end up with borders and the border specifications appear in the replace dialog box. Any idea why this is or how to fix it? Here's my macro:
test2 Macro
' Macro recorded 7/6/2006 by MCSD
'
ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View. _
ShowAll
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceDouble
.Alignment = wdAlignParagraphLeft
.FirstLineIndent = InchesToPoints(0.5)
.CharacterUnitFirstLineIndent = 0
End With
Selection.Find.Replacement.ParagraphFormat.TabStops.ClearAll
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = "^t"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.HomeKey Unit:=wdStory
End Sub
Any help would be GREATLY appreciated!!