Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to read the value of list box in the front end to vba scritp editor.
for instance I have column name called Trans that contains 100,400,500 and I would like to use the Trans in the module script editor, is it possible.
Regards
Chriss
You can try something like this:
Set myFld = Activedocument.Fields("Trans")
Set myValues = myFld.GetSelectedValues
If myValues.Count = 1 Then
Msgbox myValues.Item(I).Number
Else
Msgbox "There are " & myValues.Count & " selected values"
Next
You can also iterate through selected values with something like this:
For I = 0 To myValues.Count - 1
N = myValues.Item(I).Number
...
Next
Don't forget Msgbox only will work with IEPlugin, never with Ajax...
And be careful with the Number property: sometimes you have to use Text property.
Hope this helps!
Hi Chriss
this below code will give you the selected values in the listbox(fieldname)
field_name is the field name that is used in the listbox
SET lbs = ActiveDocument.Fields("Field_name")
SET lbsV = lbs.GetSelectedValues
lbsV(is an array wich will store all the selected values in the listbox(field)
regards
Harsha
Hi,
Thanks for your support.
Currently I am testing the script as what you advised, let me update you tomorrow.
Regards
Chriss