Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

formfield.result limitations?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FroDaddy - 14 Jan 2005 15:37 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.