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 / February 2005

Tip: Looking for answers? Try searching our database.

Generate Document Variables from a multiline text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angela - 21 Feb 2005 19:53 GMT
I am creating a userform for a meeting agenda template.  When the user types
in the agenda items in a multiline text box, I would like to assign each
agenda item (each paragraph or line) to a document variable.  The number of
items will vary with each meeting, so that is why I decided to use the
multiline text box.

Jay Freedman kindly offered this advice:

You need to "parse" the string that you get from the text box's .Text
property -- that is, separate it into substrings with one agenda item in each
one. To do this, you'll have to know what character or set of characters
serves as the separator between agenda items in the big string. It may be a
paragraph mark (Chr$(13)) but that needs to be tested on some real input. I
seem to recall that text boxes use the pair of characters Chr$(13) &
Chr$(10), or maybe the reverse.

Once you know the right character(s), you should be able to use the Split()
function to break up the big string and put the substrings into a Variant
array. Then you can use a For Each loop to put the substrings into document
variables.

I have struggled all day to find the right codes, please help
Doug Robbins - 23 Feb 2005 01:24 GMT
Rather than a multiline textbox, I would use a textbox in conjunction with a
listbox with a couple of command buttons, one for adding an item from the
textbox to the listbox (assigning the item to a document variable at the
same time), and another for moving and item from the listbox back to the
textbox (deleting the value from the associated document variable at the
same time) where it can be edited if necessary or deleted entirely.

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

>I am creating a userform for a meeting agenda template.  When the user
>types
[quoted text clipped - 25 lines]
>
> I have struggled all day to find the right codes, please help
 
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.