In LotusScript (Domino 12.0.1FP1, Notes 12.0.1) we prepare a Memo in the user's mail database. Sometimes, the above error pops up: Specified database is not currently open: Server/ORG mail.box It happens when the user clicks Send in the Notes client. It works for me on my system, so I cannot reproduce the error here. AFAIK, the code doesn't even work with mail.box directly, so can someone help me finding out where the error comes from?
UPDATE
Set maildb= Applications.getDb(MYMAIL)
Set memo= New NotesDocument(maildb)
Call memo.ReplaceItemValue("Form", "Memo")
Call memo.ReplaceItemValue("SendTo", sendTo)
Set exporter= New DocGenerator(topic)
Set exporter.TemplateDatabase= tdb
Call exporter.Open("Notes", doc)
Call exporter.SaveToDocument(memo, "Body")
Set body= memo.GetFirstItem("Body")
Call body.AddNewline(2)
If metbrief Then
Call body.AppendRTItem(doc.GetFirstItem(rtname))
Call body.AddNewline(2)
End If
If extra<>"" Then
Call body.AppendRTItem(doc.GetFirstItem(extra))
Call body.AddNewline(2)
End If
Call appendUserMailSignature(body)
Call memo.Save(True, False)
Call ws.EditDocument(True, memo)
Call uiDoc.Close
Notes:
UPDATE
The database that cannot be opened isn't even mentioned, so I wonder whether the original error with mail.box is accurate or not. I'll ask the user to show me what she does exactly.
Solved. Code in the main document's form prepared a rich-text field with an attachment.
' reopen doc, to "fix" rich text...
Dim db As NotesDatabase
Set db= doc.ParentDatabase
id= doc.NoteId
Delete uidoc ' implies Delete doc
Set doc= db.GetDocumentByID(id)
Now the doc is fully refreshed and contains a valid rich-text field.