Hi Everyone,
I wrote this agent to change the form names because I made modifications to the old form, but I keep getting this error. Here's the code:
Sub Initialize
Dim session As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim formName As String
Dim form As NotesForm
Dim count As Integer
On Error GoTo ErrorHandler
Set session = New NotesSession
Set db = session.Currentdatabase
Set view = db.Getview("vwDesignerOldRequests")
Set doc = view.Getfirstdocument()
count = 0
While Not (doc Is Nothing)
formName = doc.Form(0)
If formName = "Air Travel & Forex Authorisation Foreign" Then
count = count + 1
doc.Form = "Air Travel & Forex Authorisation Foreign - Old Design"
doc.HeaderTitle = "Air Travel & Forex Authorisation Foreign - Old Design"
doc.WorkflowObject = "Air Travel & Forex Authorisation Foreign - Old Design"
ElseIf formName = "Air Travel & Forex Authorisation Foreign HOD" Then
count = count + 1
doc.Form = "Air Travel & Forex Authorisation Foreign HOD - Old Design"
doc.HeaderTitle = "Air Travel & Forex Authorisation Foreign HOD - Old Design"
doc.WorkflowObject = "Air Travel & Forex Authorisation Foreign HOD - Old Design"
End If
doc.Save True, False
Set doc = view.Getnextdocument(doc)
Wend
MessageBox "Forms converted are: " & count
Exit Sub
ErrorHandler:
Dim errMessage As String
errMessage = "The following error occured in " + db.Title + "on line " + CStr(Erl) + " of " + session.CurrentAgent.Name + Chr(13) + Error + Chr(13) + Chr(13) + "Do you want to resume?"
If (MessageBox(errMessage + Chr(13) + Chr(13), MB_YESNO + MB_ICONEXCLAMATION + MB_DEFBUTTON2 + MB_APPLMODAL, "Error " + CStr(Err)) = IDYES) Then
Resume Next
Else
Exit Sub
End If
End Sub

Error 4005 - Entry not in index (Walter O Oriaro... 7.May.12)
. . 