Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I copyTo multiple recipients

Posted on 2004-04-30
3
Medium Priority
?
598 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

810 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