>Hello,
>
[quoted text clipped - 10 lines]
>Thanks in advance!
>Jack
Hi Jack,
As the saying goes, you ain't gonna believe this one! As you saw
already, the Fields collection and the FormFields collection aren't
connected (how stupid is that?). Here's what you have to do to get
from here to there:
Sub foo()
Dim oFld As Field
Dim oRg As Range
Dim oFfld As FormField
Dim numrslt As Long
Dim rslt As String
For Each oFld In ActiveDocument.Fields
With oFld
If .Type = wdFieldFormDropDown Then
Set oRg = .Result ' range of interior of dropdown
' expand the range by 1 char left & right
oRg.MoveStart unit:=wdCharacter, Count:=-1
oRg.MoveEnd unit:=wdCharacter, Count:=1
' grab the FormField from the range
Set oFfld = oRg.FormFields(1)
' get the index of the selected value
numrslt = oFfld.DropDown.Value
' get the text of the selected value
rslt = oFfld.DropDown.ListEntries(numrslt).Name
' do what you like with it
MsgBox rslt
End If
End With
Next oFld
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Jack - 14 Sep 2005 12:55 GMT
Works perfectly. Thanks so much!
> >Hello,
> >
[quoted text clipped - 50 lines]
> Jay Freedman
> Microsoft Word MVP FAQ: http://word.mvps.org