View Single Post
 
Old 01-04-2016, 04:41 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Try something based on:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim ArrClr, ArrPref, ArrSuff, i As Long
ArrClr = Array(RGB(255, 0, 102), RGB(0, 176, 240))
ArrPref = Array("[KEEP]" & vbCrLf, "[MOVE]" & vbCrLf)
ArrSuff = Array("[END]" & vbCrLf, "[END]" & vbCrLf)
With ActiveDocument.Range.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Forward = True
  .Wrap = wdFindContinue
  .MatchCase = False
  .MatchWholeWord = False
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  For i = 0 To UBound(ArrClr)
    .Font.Color = ArrClr(i)
    .Replacement.Text = ArrPref(i) & "^&" & ArrSuff(i)
    .Execute Replace:=wdReplaceAll
  Next
End With
Application.ScreenUpdating = True
End Sub
I haven't incorporated your "[EDIT]"/"[END]" code as you've already used its colours for your "[KEEP]"/"[END]" code.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote