29.07.2007

Quick-Tipp: Programmatically create memo with doclink on top, sig on bottom

>>Author:  Thomas Bahn
>>Ort:     Raisdorf
        
URL: http://www.assono.de/blog/d6plinks/TBAN-75KNM5

Category: Quick-Tipp, Lotus Notes, Entwicklung

Quick-Tipp
Joe Litton has written some LotusScript code to programmatically create a memo with a doclink on top and the signature of the current user on bottom. He used a modified InsertSignature function (originally from the CoreEmailClasses script library).

But there is a much shorter solution using the formula language, if the doclink should link to the current document or the document currently selected in the current view:

@Command([EditMakeDocLink]);
@Command([Compose]; @MailDbName; "Memo");
@Command([EditGotoField]; "EnterSendTo");
@Command([EditInsertText]; "Lists of recipients...");
@Command([EditGotoField]; "Body");
@Command([EditInsertText]; @NewLine + @NewLine + "Further text..." + @NewLine);
@Command([EditGotoField]; "Body");
@Command([EditInsertText]; "Click on this link to open the referred document:  ");
@Command([EditPaste]);

Text inserted after the @Command([EditPaste]) is always inserted before the doclink! Thus you have to write the text, which should appear after the doclink first, than re-enter the body field, write the text before the doclink and than paste it.

This solution also solves the problem, that if the user closes the memo without sending it, it does not leave is unwanted draft document.

Comments

#1 Thomas,

Brilliant! I've tested your code in part of an application - where the doclink would point to a currently-opened document - and it works wonderfully.

I have another scenario, in which the user is reading a document that has a summary of multiple documents, and by each summary there is a link to allow the user to create a memo that includes a doclink pointing to the full version of a document (rather than to the open current document that displays summaries of multiple other docments). For this scenario, it appears that I still need to use the LotusScript solution.

But for the places where the user has the FULL document open, I am going to use your code. Formula is always faster, it is often simpler to maintain, and in this case it avoids the possibility of leaving an unwanted draft document.

Very cool. Thanks!
- Joe
Emoticon
Gravatar Image
#2 Still works great! Thanks for sharing this... Gravatar Image

Post A Comment

Comments

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Tags

Deutsche RSS-Feeds (German)

Custom Button Custom Button

English RSS feeds

Custom Button Custom Button