Help w/doclink

I have a form with 3 checkboxes that correspond to 3 different people. I have a script with 3 separate “if” statements to see which boxes are checked, and then send off an e-mail with a doclink. The problem is when 2 or 3 boxes are checked, the doclink is inserted twice for the 2nd recipient and three times for the 3rd recipient. How do I clear out the rich text item so only one doclink gets attached to each message?

I know there must be a better way to script this, but I had a hard enough time getting this to work as it stands now. Is it better to first create a list based on which boxes are checked, and then have it send out one e-mail? If so, how would I accomplish that?

Subject: Help w/doclink

Yes, I would create the e-mail and the recipient list once. But it’s not clear whether your “3 checkboxes” are 3 fields with choices specific to each of the 3 people, or one field that allows choosing 1-3 names.

If the latter, you should be able to do:

Call doc.Send(False, form.checkbox)

(where “doc” is your e-mail and “form” is your…form)Your checkbox field should serve as the recipients array required by the NotesDocument Send method.

Otherwise, make the recipient’s name the first choice in each of your checkbox fields, then:

Dim recipients( 1 To 3 ) As String

recipients( 1 ) = form.checkbox1(0)

recipients( 2 ) = form.checkbox2(0)

recipients( 3 ) = form.checkbox3(0)

Call doc.Send(false, recipients)

See Designer help for info on the NotesDocument Send method, as well as creating lists and arrays.

Subject: RE: Help w/doclink

It was the latter, and it works great now.

Thank you for your help.