M
mike100
Hi all, I'm really hoping someone can help me out here. I've spent days
searching countless forums and cannot find an answer to this one.
How would I modify the example macro below to search an entire document for a
string, EXCLUDING the Table OF Contents.
I've found out how to tell if the string is within a table (also included
below), but I haven't found a way of determining if the found text is within
a Table Of Contents.
Sub Macro1()
Dim MyRange As Object
Set MyRange = ActiveDocument.Range
MyRange.Find.Text = "find me"
MyRange.Find.Forward = True
MyRange.Find.Wrap = wdFindStop
MyRange.Find.MatchWildcards = WildCardSearch
Do While MyRange.Find.Execute = True
If MyRange.Information(wdWithInTable) = False Then 'Determines if
selection is within a table
'Do Stuff here
End If
Loop
End Sub
Any help would be gladly appreciated!
Kind Regards
Mike
searching countless forums and cannot find an answer to this one.
How would I modify the example macro below to search an entire document for a
string, EXCLUDING the Table OF Contents.
I've found out how to tell if the string is within a table (also included
below), but I haven't found a way of determining if the found text is within
a Table Of Contents.
Sub Macro1()
Dim MyRange As Object
Set MyRange = ActiveDocument.Range
MyRange.Find.Text = "find me"
MyRange.Find.Forward = True
MyRange.Find.Wrap = wdFindStop
MyRange.Find.MatchWildcards = WildCardSearch
Do While MyRange.Find.Execute = True
If MyRange.Information(wdWithInTable) = False Then 'Determines if
selection is within a table
'Do Stuff here
End If
Loop
End Sub
Any help would be gladly appreciated!
Kind Regards
Mike