Problem with uidoc and backend document save

I have a small problem with the following save sequence. The objective here is to take the existing document (uidoc; backend webDoc) and create a new document (borrowerDoc) from the uidoc. I save the uidoc, close it, then save the backend doc, reopen the webDoc as uidoc, and also open the new borrowerDoc as uidoc. The save of the backend document and the opens are working fine; for some reason, the initial save is forcing a save confirmation after both documents have been opened.

Any ideas? Thanks for the help.

— code snippet —

Call uidoc.Save

Call uidoc.Close(True)



Set rtItem = New NotesRichTextItem(webDoc, "KeyBorrowerLink")

Call rtItem.AppendDocLink(borrowerDoc, "Key Borrower Doc Link")

Call webDoc.Save(True, False)

'reopen source work request

Set uiDoc = workspace.EditDocument(True, webDoc) 		

'open borrower document

Set uiDoc = workspace.EditDocument(True, borrowerDoc)

Subject: problem with uidoc and backend document save

Where are you calling this code from? If you are calling the code from the uidoc, then uidoc.Close will be the last statement executed because the uidoc cannot close until all of the code has run.