My script is designed to copy a document, but it won’t ‘close’ the currentdoc (or just switch to duplicate doc would be fine).In addition, now I am getting Object variable not set on the ‘edit document’ line, which was working OK yesterday.
Any ideas? Details below:-
uidoc.close gives the error’variant does not contain an object.
I also tried currentDoc.close(True)
which gives the error
‘Illegal Use of Property’ or
or Call currentDoc.close(True) which gives the error
‘Illegal Use Of Property’
Heres the code again:-
Sub Click(Source As Button)
Dim uiws As New NotesUIWorkspace
Dim session As New NotesSession
Dim currentDB As NotesDatabase
Dim profileView As NotesView
Dim profileDoc As NotesDocument
Dim currentDoc As NotesDocument
Dim duplicateDoc As NotesDocument
Set currentDB = session.CurrentDatabase
Set currentDoc = uiws.CurrentDocument.Document
Set duplicateDoc = New NotesDocument(currentDB)
Call currentDoc.CopyAllItems(duplicateDoc)
Dim eval As Variant
unique = Evaluate(“@Unique”, doc)
Call duplicateDoc.ReplaceItemValue(“OurRef”, unique)
'Call duplicateDoc.ReplaceItemValue(“Stage”, " ")
'Call duplicateDoc.ReplaceItemValue(“ReqCmpDte”, 0)
'Call duplicateDoc.ReplaceItemValue(“Dateneed”, Now + 7)
Call duplicateDoc.Save(True, True)
Dim workspace As NotesUIWorkspace
Call currentDoc.close(True)
'uidoc.Close
Set uiDoc2 = workspace.EditDocument(True, duplicateDoc)
End Sub