I have a need to populate a formfield based on listbox selections. The
problem is I can't get the formfield.result to accept over 256 character
string. I've tried using a string and appending the next listbox selection
to it, but that generates the "string too large" error.
Then I tried calling this subroutine for every option in the listbox:
dim counter as integer
dim fldInput as FormField
set fldInput = activedocument.formfields(2)
public sub buildorders(passOrder as string)
if counter = 0 then
fldInput.result = passOrder
else
fldInput.result = fldinput.range.text & vbCr & passOrder
end if
counter = counter +1
end sub
That still has the same error that the string is too large. Is there a
method on the formfield object that will allow me to append inside the
formfield? I've tried insertafter, but that inserts text after the formfield
itself.
The purpose for this is so after the user selects the options from the
listbox, it populates the formfield so the user can edit that in a template
if needed.
Jay Freedman - 14 Jan 2005 15:44 GMT
See http://word.mvps.org/FAQs/MacrosVBA/SetLongFmFldResult.htm.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
> I have a need to populate a formfield based on listbox selections.
> The problem is I can't get the formfield.result to accept over 256
[quoted text clipped - 25 lines]
> listbox, it populates the formfield so the user can edit that in a
> template if needed.
FroDaddy - 14 Jan 2005 16:19 GMT
Thanks that worked like a champ