Lotus script question

5 pts.
Tags:
Lotus Notes
LotusScript code
Hi,

I have some lotus script that creates multiple documents from a form and then sends a doc link to selected recipients.

What I'm trying to is the same thing except to create multiple copies of an existing document and then sends a doclink to the selected recipients .... ie If one recipient is selected then a copy is made for that recipient and the doclink is sent to them... therefore each recipient has there own doc to link back to.

Here is the code I want modify to do that with ... any clues on how I can do that with a document.... preferably via a button that is available on the doc when it's open. Note-- The document will have a rich text field on it.

Sub TrainingSend()
     
      Dim session As New NotesSession
      Dim workspace As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim uidoc As NotesUIDocument
     
      Dim memo As NotesDocument
      Dim picklist As Variant
      Dim fieldA As String
      Dim vecFieldB() As String
      Dim k As Integer
      Dim serverName As String
      Dim dbName As String
      Dim readersArray(1) As String
      Dim rtItem As NotesRichTextItem
      Dim view As NotesView
     
Dim Field As NotesItem
Dim ArchiveM As String 
Dim collection As NotesDocumentCollection      
     
     
     
     
      Set db = session.Currentdatabase
      Set collection = db.UnprocessedDocuments
      ArchiveM = InputBox$("Enter deadline date for completion. (dd/mm/yyyy)", "Deadline Date")
     
     
     
      'Prompt for FieldB multiple values
      picklist = workspace.PickListStrings( _
      PICKLIST_CUSTOM, _
      True, _
      db.Server, _
      db.Filepath, _
      "Xpeerpick1", _
      "Name Picker", _
      "Please select the names of people who will recieve the review.", _
      3 )
     
      If ( IsEmpty( picklist ) ) Then
            Exit Sub
      Else
            k = 0
            ForAll plist In picklist
                  ReDim Preserve vecFieldB(k)
                  vecFieldB(k) = plist
                  k = k + 1
            End ForAll
           
      End If
     
      'Create document(s) and send email(s)
      ForAll plist In picklist
           
            'Create document
            Set doc = db.CreateDocument
           
            doc.Form = "Training"
            'doc.FieldA = fieldA
            doc.FieldB = plist
            doc.ddate  = ArchiveM
            'Setting readers field
            Dim nnFieldB As New NotesName(plist)
            readersArray(0) = "[Peer]"
            readersArray(1) = nnFieldB.Canonical
            Dim readersField As New NotesItem(doc, "Readers", readersArray, READERS)
            Dim authorsField As New NotesItem(doc, "Authors", readersArray(1), AUTHORS)
           
            Call doc.Save( True, False )
           
            Call workspace.ViewRefresh
            'Send email
           
            Set memo = New NotesDocument(db)
            memo.Form = "Memo"
            memo.SendTo = plist
            memo.Subject = "Company Ratings Review Notification -- This document has been assigned to you for completion."
           
            Set rtItem = memo.CreateRichTextItem("Body")
           
            Call rtItem.AddNewLine(2)
            Call rtItem.AppendText("Please click on the icon to open the corresponding document. ------> ")           
            Call rtItem.AppendDocLink(doc, "Click to open the document")
           
            Call memo.Send( False )
            Set view = db.GetView( "PerfIncom" )
            Call view.Refresh
           
           
      End ForAll
     
End Sub


Software/Hardware used:
Lotus script

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following