Rather than trying to embed a button, I would consider taking advantage of the 'stored form in document' feature of Notes.
I.e., using Domino Designer I would manually create a database (I'll call it "MyDb.nsf" for convenience). Create a form in this database ("MyForm" for convenience) and set it up with the required fields for an email message (SendTo, Subject, Body, etc.). Then create a button on the form and enter the LotusScript code.
With this done in advance, your code can take advantage of the optional attachForm
parameter in the Document.send() method.
What you would do is open MyDb.nsf in the usual way, then use Database.createDocument()
to create your document in that database, then use Document.ReplaceItemValue("Form","MyForm")
to bind this document to your form. Also set the other Items (e.g., Subject, SendTo, Body) as needed, and when you're all done call Document.send(true)
. This will embed your form in the document and send it, so the LotusScript code will travel in the embedded form that is sent with the message.
I think this might be the best method for you, because I think that this will preserve the signature on the form when it embeds it. I'm not sure about that, but on the other hand I'm much more certain that any other way of sending with CORBA/IIOP will give you an unsigned script (because CORBA/IIOP has no access to the private key needed to sign the document). And an unsigned script will mean that your users get ECL warnings when they execute it -- and that could result in them adding an entry to their ECL to permit unsigned scripts, and that's a bad security practice.