Dim pField as Word.Field
Dim pTOC as Word.Range
'First, find the TOC --
For each pField in ActiveDocument.Fields
if pField.Type = wdFieldTOC then
set pTOC = pField.Result
exit for
end if
Next
'Now check if the selection is inside it
If Selection.Start >= pTOC.Start and Selection.End <= pTOC.End then
... yes it is
Note that there's an ambiguity about 'selection within the TOC' -- do you
mean wholly contained within, or merely includes at least some of it? (eg
you can select a range with the start within and the end outside, or vice
versa).