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.
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
'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")
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!