Function DocReplaceItem(sourceDoc As NotesDocument, targetDoc As NotesDocument, fldnm As String) As Integer ' this function replaces the item value in target document with the same one in sourceDoc using the fieldname (fldnm) passed Dim tmpItem As NotesItem ' temporary working item, item for fldnm Set tmpItem=sourceDoc.GetFirstItem(fldnm) If Not (tmpItem Is Nothing) Then ' note this function will replace the target item's value(s), unless the datatype for the items are incompatible ' if datatypes are incompatible, an error is thrown Call targetDoc.ReplaceItemValue(fldnm, tmpItem) End If ' return success DocReplaceItem=1 Exit Function FunctionErrorHandler: ' return failure DocReplaceItem=0 End Function