I have an action button on a form in Lotus Notes that creates an outlook mail message, assigns values from the document to the To, Subject, and Body fields and sends it. It works fine if I give it one name to send to. If I try to give it multiple recipients it gives the following error:
OutILib.dll: Outlook does not recognize one or more names.
The names are spelled correctly and they are valid in Outlook. How do I tell Outlook that I want the message to go to multiple people? I am pulling the names from a SendTo field on the current document. Here is the code:
Sub CreateOutlookMsg (doc As NotesDocument)
Dim Sendnames As Notesitem
Set Sendnames = doc.GetFirstItem("SendTo")
'Get an outlook application object
Set objSession = CreateObject("Outlook.Application")
'Create a new message
Set objMessage= objSession.CreateItem(olMailItem)
'Set the subject and message fields
cnumber = doc.ComplaintNumber(0)
createdby = doc.Author(0)
'Set the SendTo Fields on the
recips = Sendnames.Text
Subject$ = "New Suspected Adverse Drug Reaction report (THIS IS A TEST)"
Message$ = "A new report has been submitted by " & createdby & _
" for record " & cnumber & "."
Set objRecipient = objMessage.Recipients.Add (recips)
objMessage.subject = Subject$
objMessage.Body = Message$
Thanks for any help you can provide!