G
Greg Maxey
Can someone explain why the following snippet of code fails to delete all of the list entries in a dropdown field:
Sub Test()
Dim oFFld As FormFields
Dim oLe As ListEntry
Set oFFld = ActiveDocument.FormFields
For Each oLe In oFFld("Dropdown1").DropDown.ListEntries
oLe.Delete
Next
End Sub
It seems to always leave one or tow list entries in the dropdown list
The following code seems to take care of all of them, but I am curious as to why the above code won't work:
For i = oFFld("Dropdown2").DropDown.ListEntries.Count To 1 Step -1
oFFld("Dropdown2").DropDown.ListEntries(i).Delete
Next
Thanks
Sub Test()
Dim oFFld As FormFields
Dim oLe As ListEntry
Set oFFld = ActiveDocument.FormFields
For Each oLe In oFFld("Dropdown1").DropDown.ListEntries
oLe.Delete
Next
End Sub
It seems to always leave one or tow list entries in the dropdown list
The following code seems to take care of all of them, but I am curious as to why the above code won't work:
For i = oFFld("Dropdown2").DropDown.ListEntries.Count To 1 Step -1
oFFld("Dropdown2").DropDown.ListEntries(i).Delete
Next
Thanks