Hi All,I’m having trouble with the simplest script that I’ve used before. The GetDocumentByKey is not getting a document. Any ideas???
Kari
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim lookupView As NotesView
Dim doc As NotesDocument
Dim newDoc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView("EmpName04")
Set lookupView=db.GetView("EmpName05")
Set doc = view.GetFirstDocument
counter@ = 0
While Not(doc Is Nothing)
counter@ = counter@ + 1
Print "Processing Document Number: " & Cstr(counter@)
empName$ = doc.Name(0)
title$=doc.Title(0)
key=empName$
Set newDoc = lookupView.GetDocumentByKey(key)
Do While Not ( newDoc Is Nothing )
newDoc.Title=title$
Call doc.PutInFolder("Duplicates")
Loop
Set doc = view.GetNextDocument(doc)
Wend
End Sub