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:
Related Q&A from Cregg Hardwick
A user wants to know if it's possible for LotusScript to read an attachment in a Notes document without first detaching it. Find out our expert's ...continue reading
Learn about different options using LotusScript code and Formula language to customize the principal field of outgoing Lotus Notes email messages.continue reading
Read about merging cells in a Microsoft Word table using LotusScript and an Excel example, along with the thought process that goes along with it.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.