Canot close the doc, both uidoc and doc are opened after saving

I tried closing the documents with some code but it either gives me replica copy etc…

how can I have the uidoc to be opened and the doc to be closed yet have my data saved in the richtext field…

Set uidoc = ws.Currentdocument

uidoc.editmode = True

Set doc = uidoc.document

.

.

.

.

Call item.AppendText(Format$(Now, “mm/dd/yy hh:nn AM/PM”) & " + " & doc.info(0) & & s.commonusername )

Set item2 = item

Call doc.ReplaceItemValue(“item”, “”)

Call doc.save(True,True)

Set uidoc = ws.EditDocument( True , doc)

Subject: canot close the doc, both uidoc and doc are opened after saving.

You need to close the uidoc and then reopen again. Something like:

''You don’t need to change it into editmode, but if it is already I do a save to prevent replication conflicts

if uidoc.editmode = true then

uidoc.save

End if

set doc = uidoc.document

’

’

’

call doc.save(true, true)

'put a SaveOptions field on your form with default value “1”

'check for edit mode again

if uidoc.editmode = true then

call uidoc.fieldsettext(“SaveOptions”, “0”)

End If

call uidoc.close

dim uidoc2 as notesuidocument

set uidoc2 = w.editdocument(true, doc)

hth

Dan