Thread: [Solved] Continuous Loop
View Single Post
 
Old 01-06-2011, 08:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi cksm4,

Assuming you're appending rows, try the following:
Code:
Sub Test()
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Text = "DO NOT PUBLISH ACTIVITY"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    MsgBox .Text
    .MoveStart Unit:=wdRow, Count:=-1
    .MoveEnd Unit:=wdRow, Count:=3
    .Font.Hidden = True
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
End Sub
I've kept the -1 and +3 moves you originally had, but they might need adjustment to target the correct ranges.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote