View Single Post
 
Old 01-26-2019, 10:59 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:
Code:
Sub Demo()
With Selection
  With .Find
    .ClearFormatting
    .Text = "[#Des2]"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  If .Find.Found = True Then
    If .Information(wdWithInTable) = True Then
      .MoveEnd Unit:=wdRow, Count:=1
      .Copy
      .Collapse wdCollapseEnd
      .PasteAppendTable
    End If
  End If
End With
End Sub
Note the inclusion of error-checking.

PS: I can't see the point of your '.Replacement.Text = "1998-11-27"' as nothing gets replaced.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote