开发者

Copy text from template into mail (Lotus Notes)

I'm trying to create a toolbar button that inserts a footer (including some buttons) into the current mail.

As far as I know, theres no way to create and modify buttons directly with Lotus Formula, so I'm trying to copy/paste from another document. I can't use a mail template because I need the text to be inserted in replies.

This is what I have assembled from 开发者_JAVA百科online examples:

@PostedCommand([FileOpenDatabase]; "SERVER" : "mailbox.nsf"  ; 
    "($All)" ; "" ; 1 ; 1 ) ;
@PostedCommand([OpenDocument] ; "" ; "34884517EED80C33C125A999005301D4") ;
@PostedCommand([EditDocument]) ;
@PostedCommand([EditGotoField] ; "Body" ) ;
@PostedCommand([EditSelectAll]) ;
@PostedCommand([EditCopy]) ;
@PostedCommand([FileCloseWindow]) ;
@PostedCommand([FileCloseWindow]) ;
@PostedCommand([EditPaste])

This works inconsistently, depending on what I am looking at when pressing the button. Sometimes it opens a search box with the actual text of the mail pasted in it. It does seem to close the new mail.

I'm especially confused because many commands don't take any arguments, eg FileCloseWindow. How do I control the "context" of the commands or check for success?

It feels like doing automation with SendKeys - fire off a chain of commands and hope that nothing unexpected happens. Of course, I am a total noob with Lotus Formula, so I may be doing this totally wrong. Any help is appreciated.


You may want to use Alan Lepofsky's free "Paste Information" application.

The Notes database "Paste Information" serves as the repository for the content you wish to reuse. Move the cursor to the position where you want to insert the text, click on the "Paste Information" Toolbar icon and then choose the document (aka. text) to insert.

http://www.alanlepofsky.net/alepofsky/alanblog.nsf/dx/paste-information-application


There really isn't a good solution for this using formulas. You'll be stuck in the SendKey-like world you describe.

If you can modify the mail template even a little, you could add a form to it that includes your text and buttons, instead of grabbing it from a central database. Then you could automate creating a new document based on that form, copying the contents, etc. That could help the automation work consistently and perhaps more quickly since it would be getting the resource from within its own database.

You could also then add a shared action button to all the mail forms (memo, reply, etc) that runs this formula, which would make distribution a lot easier.

I'm afraid even with LotusScript, this is an impossible task because you can't insert rich text into a UI document ( or at least not in the version I am running ).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜