When used in a form action, this code will invite users to click a button, browse for a file, and then insert a shortcut to that file in a rich-text field. This is ideal for items like a Lotus Notes discussion database, because it provides an easy way for users to create a pointer to a shared file.
This code is made up of Formula language for a form action, and a LotusScript agent that is called by the Formula script.
Formula language for the form action:
The LotusScript agent:
MEMBER FEEDBACK TO THIS TIP
A pseudo protocol is a very simple way to create a shortcut for a file. If you add a string that looks like the following, it becomes a clickable hyperlink to the file:
file:\\servername\directory and path\filename.
Thierry S.
******************************************
I believe there are a couple of errors in this agent that I'd like to point out:
First, in the (file shortcut) agent,
dpath=sh.expandenvironmentstrings("%windir%" & "temp") is incorrect. Instead, there should be a backslash with "temp" to read dpath=sh.expandenvironmentstrings("%windir%" & "\temp").
Also in the (file shortcut) agent, fname=strrightback(a(0,"",5) returned nothing, which may have been by de
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

sign. But changing this to fname = strrightback(Strleftback(a(0),".",5), "\", 5) returns a file name.
Chris L.
******************************************
Thanks for the feedback, Thierry, although the drawbacks to the pseudo file protocol are originally what prompted me to develop this workaround.
For example, when using file:\\servername\directory and path\filename, there are often issues if there's a space in the filename. Also, I have had reports of Internet Explorer 7 users struggling to launch links created with this protocol.
Jon Urwin, tip author
Do you have comments on this tip? Let us know.
Related information from SearchDomino.com:
Learning Guide: LotusScript
Learning Guide: Formula language
FAQ: LotusScript advice
FAQ: Formula language advice
Reference Center: LotusScript tips and resources
Reference Center: Formula language tips and resources
This tip was submitted to the SearchDomino.com tip library by member John Urwin. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.