How can I modify Lotus Notes mail preferences (change the signature) using LotusScript?
Such preferences are stored in a profile document in the Lotus Notes user's mailbox. To change them programmatically, simple use the following code:
Dim Preferences As notesdocument Set Preferences = MailBox.GetProfileDocument ("CalendarProfile")
Where "MailBox" points to the Lotus Notes user's mail database. If you are running the code within the mail database, this is done by calling:
Dim session as new notesSession Dim mailbox as notesDatabase Set MailBox=Session.CurrentDatabase
Otherwise, use the Formula language command @MailDbname or methods of the LotusScript object NotesRegistration to find the user's Lotus Notes mail file.
Once you have the profile document, you will need to either point it to an HTML signature file to add the signature text directly into the profile document. To use an external HTML document (which must exist on every machine where the mailfile is used), set the "SignatureOption" field to "2" and put the pathname of the Lotus Notes signature file in the Signature_1 field.
To store a signature in the profile itself, set "SignatureOption" to "1" and enter the text in the field "Signature_1". When you are done, be sure to call the save method on the profile document.
Incidentally, I figured this out a while back by looking at my own mail file in Domino Designer and examining the "Tools\Preferences" action on the "$Inbox" folder, which led to the "(Preferences)" agent, and then to the "Calendar Profile" form.
Do you have comments on this Ask the Expert Q&A? Let us know.
Related information from SearchDomino.com:
This was first published in September 2006