Quote Originally Posted by gmaxey View Post
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "(htps:/abc.kr/p)(*)( *mr smith\[/url\])"
    .Replacement.Text = "\2"
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
lbl_Exit:
  Exit Sub
End Sub
I have a word document which has drop down lists inserted in some parts of tables and main texts inside the document:





I need to be able to search inside the document , including the drop down list options (whether the dropdown item is selected or not), for the phrase "INSERT" and "Select", and when either is found, replace them numerically with "Field 1" , "Field 2". For the numbering, 1 is the first found instance at the top of the document.
My main current issue is no advanced or basic "Find" function includes the dropdown lists in word, how can I search them? I initially tried to do lists separately, and got this far:


Sub LoadSchedule()
    Dim objCC As Integer 
    Dim objCL As Integer 
     
    For objCC = 1 To ActiveDocument.ContentControls.Count
     If ActiveDocument.ContentControls(objCC).Type = wdContentControlComboBox Or _
     ActiveDocument.ContentControls(objCC).Type = wdContentControlDropdownList Then
  
        For objCL = 1 To objCC.DropdownListEntries.Count
            ActiveDocument.ContentControls(objCC).DropdownListEntries(objCL).Select
          
            Selection.Find.ClearFormatting
            Selection.Find.Replacement.ClearFormatting

            'Here do the search inside selected area and name each found
            'area iterativley
        Next
     End If
    Next
End Sub

However Ideally the whole thing would be done in one loop, any and all help is appreciated.