I'm working with a large document with multiple TOCs (each chapter has a TOC). I was looping through all of the TOCs after the document was constructed to update the field code and apply formatting because of some strange behavior.

After some trial and error, I thought that maybe the most efficient way to do it would be to find the TOC after the chapter is inserted (rather than loop through them all at the end and do Selection.MoveRight/Left/Down,etc.).

I can find the TOC by looping through the fields in the chapter and then select it. I find each tab and format it with a dotted underline (I couldn't consistent results other ways which is one of the strange behaviors I was experiencing).

I do a Find vbtab and then a Do While .Execute = True and format the underline. It works great but it does the loop twice which is unnecessary. Any thoughts? Here's the block of code:

        Dim myFldNm As String        Dim myFld As Field
        For Each myFld In ActiveDocument.Sections.Last.Range.Fields 'Loop thru Fields in the Section
            If myFld.Type = 13 Then ' wdFieldTOC Then
                myFld.Select
                Selection.Font.Bold = False
                Selection.Font.Underline = wdUnderlineNone
                Selection.Font.Name = "Times New Roman"
                Selection.Font.Size = 10
                Selection.ParagraphFormat.SpaceAfter = 0
                Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(6.5), Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces 'Eliminates all the dotted lines
                With Selection.Find
                    .Forward = True
                    .Text = vbTab 'Find the Tab
                    .Wrap = wdFindContinue
                    .MatchWildcards = True
                    Do While .Execute = True
                        Selection.Font.Underline = wdUnderlineDotted
                    Loop
                    Exit For
                End With
            End If
        Next