These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

VBA and getField from a multiselected listbox

manarus
Registered: Dec 8 2011
Posts: 3

In MS-Access, I am getting an error message when I try to read a multi-selected item from list box :
 
Set jso = pdFormCapture.GetJSObject

If jso.numFields Then
 
For I = 0 To jso.numFields - 1
FV = ""
fn = ""
fn = Trim(jso.getNthFieldName(I))
Set f = jso.getField(fn)

If f.Type = "listbox" Or f.Type = "Combobox" Then
FV = f.Value
  

End If

thanks

My Product Information:
Acrobat Pro 10.0, Windows
maxwyss
Registered: Jul 25 2006
Posts: 255
Read the Acrobat JavaScript documentation. There it specifies the format of the data returned from a listbox with multiple selections. (hint: the value property won't work).

Hope this can help.

Max Wyss.

manarus
Registered: Dec 8 2011
Posts: 3
Thanks, but I still can't figur out selected items only?

thanks

George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Exactly what error message do you receive? The value will be an array when multiple items are selected in a list box, as opposed to a string (or anything else).

Also, it should be "combobox", not "Combobox".
manarus
Registered: Dec 8 2011
Posts: 3
It's a listbox with multiselected items
I am getting type not match?
should I do the following:

If f.multipleSelection = True Then
Dim A As Variant
A = Array(f)
end if

do you have a sample

thanks