> Part of the solution to your scenario is given here:
>
http://enterprise-solutions.swits.net/infopath/generate-string-email-addresses-list-vbscript.htm>
> The other part should be pretty straightforward to produce now: For the
> group you need to add an XPath filter when retrieving the contact rows. And
> to fill the "To" field it is best to just set the "To" field's value equal to
> the value of the "emailAddresses" field using a formula.
> ---
> S.Y.M. Wong-A-Ton
>
>
> "Hasse" wrote:
>
> > Hi,
> >
> > I can wait until next week if you can provide me with a solution.
> > To help you do this I shall try to explain what I wan't to do.
> > In SharePoint I have a Contacts List with columns for E-mail address and
> > Group.
> > In my InfoPath form I get the E-mail address from all contacts that belongs
> > to the groups Market and Coordinator in to a List Box. Wen clicking on a Send
> > Mail button
> > I wan't to, using VB-script, merge the E-mail addresses in my List Box and
> > put them in the To field in my mail, like,
> > recipient1[ at ]mail.com;recipient2[ at ]mail.com;recipient3[ at ]mail.com.
> > Hope this is enough for you to solve this problem of mine.
> >
> > Regards,
> > Hans
> >
> > "S.Y.M. Wong-A-Ton" wrote:
> >
> > > The steps I outlined are the steps you need to take; I cannot explain more
> > > unless you have a more specific question. I'm very tight on time these days,
> > > so give me a couple of days and I might be able to put together a solution
> > > for you and post it on my website by next week.
> > > ---
> > > S.Y.M. Wong-A-Ton
> > >
> > >
> > > "Hasse" wrote:
> > >
> > > > Hi,
> > > >
> > > > Thanks for trying to help me with this but after looking around in the
> > > > newsgroup I have to admit that I have not become any wiser.
> > > > Can you please explain this a little bit more and maybe provide me with some
> > > > code?
> > > > And yes, my List Box is being populated by a secondary data source,
> > > > SharePoint Contacts List.
> > > >
> > > > Regards,
> > > > Hans
> > > >
> > > > "S.Y.M. Wong-A-Ton" wrote:
> > > >
> > > > > If your list box is being populated by a secondary data source, you can
> > > > > retrieve the data source in code (by using e.g.
> > > > > XDocument.GetDOM(<data_source_name>)), select the rows under the main group
> > > > > node for the rows (using selectNodes() on the DOM of the secondary data
> > > > > source), and then loop through all the rows while you build a string and
> > > > > concatenate the values you need, and then write the results to the text box
> > > > > (using XDocument.DOM.selectSingleNode(<xpath_to_text_box>).text = value)
> > > > >
> > > > > Search this newsgroup on the functions I've mentioned (GetDOM, selectNodes,
> > > > > selectSingleNode) to find examples on how to get this done.
> > > > > ---
> > > > > S.Y.M. Wong-A-Ton
> > > > >
> > > > >
> > > > > "Hasse" wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > In my InfoPath form I have a List Box with several rows of data collected
> > > > > > from a SharePoint list.
> > > > > > If I would like to use vb script to merge all the rows so it will look
> > > > > > something like this: row1data;row2data;row3data;..... and put it in a Text
> > > > > > Box how can I accomplish that?
> > > > > >
> > > > > > Any assistance would be highly appreciated,
> > > > > > Hans