Hi,
On click of the Save button,
I am getting the error “Object Variable not set”, before entering into the code.
Below is Save button code:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim session As New NotesSession
Dim db As NotesDatabase
Dim viewUNID As NotesView
Dim docForDocLink As NotesDocument
Dim docOld As NotesDocument
Dim sUNIDForDocLink As String
Set uidoc = ws.CurrentDocument
If uidoc.EditMode <> False Then
Call uidoc.Refresh
End If
Set doc = uidoc.Document
sUNIDForDocLink = doc.GetItemValue("UNIDForDocLink")(0)
Set db = session.CurrentDatabase
Set viewUNID = db.GetView("vUNID")
Call viewUNID.Refresh
Set docForDocLink = viewUNID.GetDocumentByKey(sUNIDForDocLink, True)
Set docOld = db.CreateDocument
Call docForDocLink.CopyAllItems(docOld, True)
Call docOld.Save(True, True)
Forall ITEM In docForDocLink.Items
Call ITEM.Remove
End Forall
Call doc.CopyAllItems(docForDocLink, True)
Call docForDocLink.Save(True, True)
Call doc.ReplaceItemValue("SaveOptions", "0")
Call uidoc.Close
End Sub
What may be the issue? kindly help on this.
Thanks in advance,
Kamal