Solved

How do I copyTo multiple recipients

Posted on 2004-04-30
3
566 Views
Last Modified: 2013-12-18
How do I modify the following code, so that the message is copied to both john.doe@myCompany.com AND jane.doe@myCompany.com. Although I've tried doing an array, like so:

recip(0)="john.doe@myCompany.com"
recip(2)="jane.doe@myCompany.com"

I'm doing some wrong because I keep getting scripting errors.

Here's the code I need to modify:


Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim memo As NotesDocument
      Dim rtitem As NotesRichTextItem
      Set db = session.CurrentDatabase
      Dim sendto As Variant
      Set doc=session.documentcontext
      sendto="Information Center@ExchangeNA"
      If doc.IsNewNote Then  
            Set memo = New NotesDocument( db )
            Set rtitem = New NotesRichTextItem( memo, "Body" )
            msg="A new report request has been submitted. You can view the request on the web at: " & Chr(10) & Chr(10)
            msg2= "Please open the Information Center Reports database in Lotus Notes and mark the status of the request."            
            url="http://nycnotes11.myCompany.com/" & StringReplaceSubstring(db.FilePath, "\", "/") & "/ChangeNum/" & doc.UniversalID & "?OpenDocument"
            Call rtitem.AppendText(msg & url & Chr(10) & Chr(10) & msg2)
            memo.Subject = "New Report Request"
            memo.CopyTo="john.doe@myCompany.com"            
            memo.BlindCopyTo="the.man@myCompany.com"
            Call memo.Send( False, sendto)
            Call doc.save(True,False)
      End If      
End Sub
0
Comment
Question by:GessWurker
  • 2
3 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10961003
Replace this line

memo.CopyTo="john.doe@myCompany.com"  

to

memo.CopyTo= recip

~Hemanth
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 10961035
The complete code will be

Sub Initialize
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim doc As NotesDocument
     Dim memo As NotesDocument
     Dim rtitem As NotesRichTextItem
Dim recip(1) as string
recip(0)="john.doe@myCompany.com"
recip(1)="jane.doe@myCompany.com"
     Set db = session.CurrentDatabase
     Dim sendto As Variant
     Set doc=session.documentcontext
     sendto="Information Center@ExchangeNA"
     If doc.IsNewNote Then  
          Set memo = New NotesDocument( db )
          Set rtitem = New NotesRichTextItem( memo, "Body" )
          msg="A new report request has been submitted. You can view the request on the web at: " & Chr(10) & Chr(10)
          msg2= "Please open the Information Center Reports database in Lotus Notes and mark the status of the request."          
          url="http://nycnotes11.myCompany.com/" & StringReplaceSubstring(db.FilePath, "\", "/") & "/ChangeNum/" & doc.UniversalID & "?OpenDocument"
          Call rtitem.AppendText(msg & url & Chr(10) & Chr(10) & msg2)
          memo.Subject = "New Report Request"
memo.CopyTo= recip    
          memo.BlindCopyTo="the.man@myCompany.com"
          Call memo.Send( False, sendto)
          Call doc.save(True,False)
     End If    
End Sub
0
 

Author Comment

by:GessWurker
ID: 10961113
Thanks!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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