ReplaceItemValue error - syntax?

should I be able to do this…

Call notesdoc.ReplaceItemValue(“FullName”, FirstName + " " + Surname)

Or do I require to pass the values into a string and then supply…

Call notesdoc.ReplaceItemValue(“FullName”, newFullName)

Or

SOMETHING ELSE?

While Not (notesdoc Is Nothing) 

	

	notesdoc.ComputeWithForm False, False

	

	newFullname =  IFSdoc.FirstName + " " + IFSdoc.Surname

	

	Call notesdoc.ReplaceItemValue("FullName", FirstName + "  " + Surname)

	Call notesdoc.ReplaceItemValue("FullName", newFullName)

	

	notesdoc.Save True, True	

	

	Set notesdoc = notescollect.getnextdocument(notesdoc) 

	

Wend 

Thanks in advance

Subject: ReplaceItemValue error - syntax?

Call notesdoc.ReplaceItemValue(“FullName”, FirstName + " " + Surname) should work, IF FirstName and Surname are variables you’ve defined and set somewhere else. Otherwise, you’ll need

Call notesdoc.ReplaceItemValue(“FullName”, doc.FirstName(0) + " " + doc.Surname(0))

where doc is a handle to the document you’re getting the value from.

Or you could do it the easy way:

notesdoc.FullName = doc.FirstName(0) & " " & doc.Surname(0)

The only real reason to go the long route with ReplaceItemValue is if you have more than one NotesItem on your document with the same name. In that case, ReplaceItemValue removes all of them and creates a single new item with the new value you assign.