I have code written in PostDocumentDelete which works fine until it comes across ForAll statement and gives error as “Object variable not set” while runtime. I tried with declaring “i” with Dim also. All the used variables here are declared in Declarations section. Also the same ForAll loop works fine in PostSave event.
Any ideas? If anyone could help, will be appreciable.
Thanks in advance
Sub Postdocumentdelete(Source As Notesuidatabase)
Dim Modcal_Mgxml As String
Dim Modcal_MgxmllOOP As String
Dim Modcal_MgRTitem As Variant
Dim Modcal_MgCnt As Integer
Modcal_MgCnt=0
Set Modcal_MgDatabase = source.Database
Set Modcal_MgSession = Modcal_MgDatabase.Parent
Modcal_MgNotesUser = Modcal_MgSession.UserName
Modcal_MgNotesServer=Modcal_MgDatabase.Server
Modcal_MgNotesFileName=Modcal_MgDatabase.FilePath
Modcal_MgMffPath= “1-%ifclib%domino%sl%dominoifc.ecf”
Modcal_MgPrgName = “2-Modcal”
Modcal_Mgxml=“”
Modcal_Mgxml=Modcal_Mgxml+{} + Chr(13)
Modcal_Mgxml=Modcal_Mgxml + “Delete”
Forall i In Modcal_MgDocument.items
If Instr(Modcal_MgIncludeList,i.name) Then
Modcal_MgxmllOOP = Modcal_MgxmllOOP + “<” + i.name + “>” + i.text + “</” + i.name + “>” + Chr(13)
End If
End Forall
Modcal_Mgxml = Modcal_Mgxml + Modcal_Mgxmlloop
Modcal_Mgxml = Modcal_Mgxml + {}
End Sub