开发者

Change the caption of button in Lotus Notes

How can I change the caption of a button usin开发者_如何学JAVAg LotusScript/Formula?


There are no hooks into a button that will let you change it via LotusScript or a Formula. If you only have a few different captions you'd like to have on a button (and the scripts are the same), I've once stored those various predefined buttons on a hidden form, in separate richtext items, and then copied them to my doc using LotusScript. That would be useful if you were trying to generate and send a button in an email for example, but not much use unless you're generating the doc upon which the button appears programmatically as well.

You might find useful the undocumented method "addLinkByIDs" on the NotesRichTextItem class. Again, probably only useful if you're building the document on the fly, as changing rich text items on a UI doc isn't very easy to do.

More info on undocumented methods here: http://opendom.blogspot.com/2006/11/undocumented-dom-lotusscript-inventory.html

Lastly, there's always the Midas LSX from GeniiSoft, which is an add-on that gives you lots of control over rich text items. I don't know for sure, but I'd bet there's a way to change a button caption using that LSX. http://www.geniisoft.com/showcase.nsf/MidasLSX


What Ken says is true, but you can change button labels using JavaScript in the Notes client. You'll need to go to the <HTML> tab of the button properties and give the button a name value (an id value works as well in later versions), then you can use

document.forms[0].ButtonHTMLName.value = "New Caption";

or

document.forms[0].elements["ButtonHTMLName"].value = "New Caption";

Either can be triggered from any number of client events in Notes version 6 or higher using client-side or common JavaScript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜