Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I copyTo multiple recipients

Posted on 2004-04-30
3
Medium Priority
?
593 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
[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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
  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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 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