I have created a database wherein I have bunch of documents. Here is what I need to do and need help.
-
All documents are $KeepPrivate";“1” ie. Cannot copy or print.
-
I need to create a duplicate document in the same database
-
Change field “Status” of the original document from “Approved” to “Archived”
and finally
- Change field “VersionNo” by incrementing it by 1.
CAN SOME ONE PLEASE HELP.
I am not a lotus notes or programming expert. any help will be appreciated.
Regards
Ram
Subject: Create Duplicate document and change version No.
You can use the copyallitems method. The notes help has this example:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim docA As NotesDocument
Dim docB As NotesDocument
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set docA = collection.GetFirstDocument()
If Not (docA Is Nothing) Then
Set docB = New NotesDocument( db )
Call docA.CopyAllItems( docB, True )
Call docB.Save( True, True )
docA.Status = “Archived” 'I JUST ADDED FOR YOUR FIELD
docA.VersionNo = docA.VersionNo(0) + 1 'I JUST ADDED FOR YOUR FIELD
Call docA.Save( True, True ) 'I JUST ADDED FOR YOUR FIELD
Else
Messagebox “No documents found”
End If