Solved

How do I copyTo multiple recipients

Posted on 2004-04-30
3
573 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 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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