View Single Post
 
Old 06-24-2009, 09:06 AM
Bird_FAT's Avatar
Bird_FAT Bird_FAT is offline Office 2007
Expert
 
Join Date: Apr 2009
Location: South East
Posts: 271
Bird_FAT is on a distinguished road
Default

OK - what you are going to need to do is create a macro that uses the Find and Replace tool that loops through the document.

The following code will: Find "_______" and remove it. This will go through the whole document.
Code:
Find_and_replace_spaces Macro
' Macro recorded 6/24/2009 by Bird_FAT
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "_______"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Do While Selection.Find.Execute
    With Selection
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseStart
        Else
            .Collapse Direction:=wdCollapseEnd
        End If
        .Find.Execute Replace:=wdReplaceOne
        If .Find.Forward = True Then
            .Collapse Direction:=wdCollapseEnd
        Else
            .Collapse Direction:=wdCollapseStart
        End If
        .Find.Execute
    End With
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Loop
End Sub
Does that help?
Reply With Quote