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:
- the correct mail database is opened (Applications is a Singleton)
- DocGenerator is a class that uses Notes (in this case) and a template database to generate text (it can also use OpenOffice)
- that text is collected in a NotesDocument private to the generator
- SaveToDocument appends the contents of that private NotesDocument to the memo field
- rtname and extra are two more RT-fields in the current document
- AppendUserMailSignature, eh, well, it does what it says
- the memo is saved as Draft and opened on the screen
- only then, when the user clicks Send, the message appears
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.