![]() |
#2
|
||||
|
||||
![]()
Hi cksm4,
Try something along the lines of: Code:
Sub Demo() Dim tRng As Range With Selection With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "TOC" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With While .Find.Execute With .Range If .Information(wdWithInTable) = True Then Set tRng = .Tables(1).Cell(.Cells(1).RowIndex + 1, .Cells(1).ColumnIndex).Range tRng.End = tRng.End - 1 ActiveDocument.Indexes.MarkEntry Range:=tRng, EntryAutoText:=.Text, _ CrossReference:="", CrossReferenceAutoText:="", BookmarkName:="", Bold:=False, Italic:=False End If End With Wend End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
slayda | Word | 3 | 09-14-2011 02:16 PM |
![]() |
smed | Word VBA | 1 | 01-17-2011 02:18 PM |
![]() |
Bobosmite | Word | 6 | 05-27-2010 08:09 PM |
Find /Replace Help | ilcaa | Word | 2 | 11-02-2009 08:41 AM |
![]() |
KramerJ | Excel | 2 | 05-11-2009 11:33 AM |