[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Sending a document to multiple recipients using Lotusscript

Posted on 2004-10-26
9
Medium Priority
?
2,595 Views
Last Modified: 2013-12-18
I'm using Lotusscript to send an email with a doclink to multiple recipients. The list of recipients is a concatenation of several fields....this does not seem to work, though. My code works fine for a single recipient - I'm just not sure how to format the list of multiple recipients. I've tried using different delimiters and using an array, but can't anything to work.

Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Call rtitem.AppendDocLink( uidoc.Document, db.Title)
newDoc.Subject = "My subject"  
newDoc.SendTo = uiDoc.FieldGetText("Recipient1") & ", " & uiDoc.FieldGetText("Recipient2") & ", " & uiDoc.FieldGetText("Recipient3")
newDoc.Send( False )
0
Comment
Question by:mrt1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 12411489
It needs to be an array.  Assuming that recipient1, recipient2, and recipient3 each contains a single person, this would work:

Dim recipients(1 to 3) as string
recipients(1) = uiDoc.FieldGetText("Recipient1")
recipients(2) = uiDoc.FieldGetText("Recipient2")
recipients(3) = uiDoc.FieldGetText("Recipient3")
newDoc.replaceItemValue "SendTo", recipients
0
 
LVL 2

Author Comment

by:mrt1
ID: 12411771
OK, thanks. What if each of the fields (recipient1, recipient2, etc) could contain multiple names?
Would the same method still work?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12413170
Do you have multiple recipient fields? What if you use only one multi-value recipients field? You won't need the Dim recipients, just say
    newDoc.SendTo= uiDoc.Document.Recipients
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Author Comment

by:mrt1
ID: 12413390
Afraid I have multiple fields.....I can't use a single field
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12414289
Next option: can you add (another) multiple-value field, e.g. with the name Recipients, type Computed, with the formula:
    @Unique(Recipients:Recipients:Recipients3)
and use in LS:
    newDoc.SendTo= uiDoc.Document.Recipients
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12414332
Obvious mistake:
    @Unique(Recipient1:Recipient2:Recipients3)
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 375 total points
ID: 12424841
Your LotusScript could combine the values of the three fields.  The simplest code for this is:

Dim recipients As Variant
Const recipientsComboFormula = "@Trim(Recipient1 : Recipient2 : Recipient3)"
recipients = Evaluate(recipientsComboFormula, uiDoc.Document)
newDoc.Send(False,recipients)
0
 
LVL 1

Expert Comment

by:yangshuhua
ID: 12426901
1. Create a dynamic array to hold all recipients
2. For each field value, check if it has more than one value. then put all values to the dynamic array one by one
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12432688
Well, that's what Qwaletee's Evaluate will do for you, all-in-one solution.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question