Q:
How do I add new items to a combo or list box?
----
A:
You could add new items to a combo box (or to a list box) as by adding
new strings to 'Opt' array in the field dictionary. For example:
FieldIterator itr = doc.FieldFind("MyCombo");
if (itr != doc.FieldEnd()) {
Field f = itr.Current();
if (f.GetType() == Field.Type.e_choice) {
Obj field_dict = f.GetSDFObj();
Obj options_array = field_dict.FindObj("Opt");
if (options_array == null) {
options_array = Obj.CreateArray();
field_dict.Put("Opt", options_array);
}
// Add new options...
options_array.PushBack(Obj.CreateString("Item5"));
options_array.PushBack(Obj.CreateString("Item6"));
}
}