Tuesday, August 24, 2010

The Notes UI and Sending a Link to a File

Yesterday I found myself explaining to a new but technical user that Notes/Domino is, like Blackberry. An amazingly powerful and capable piece of software capable of everything that the competition is capable of - plus a whole lot more.

....and hampered by what is still one of the worst user interfaces in the world.

Sorry Notes UI team - I know you're doing your best. The same goes for the blackberry team. I know that they're doing their best too. It's just that the user interfaces have so far yet to go.

So, this morning, the same user asks me how to send a link to a file on our common drives without sending the attachment everywhere.

He's already cleverly tried attaching the .LNK file, but our policies don't allow that as it's considered to be an executable file.

I said to him that I didn't actually know. 18+ years of using the product and I still really don't know how to do this. I know several workarounds but I don't know of any one all-encompassing method.

It's sad.

Even sadder is the fact that as I received the call I was clicking the SEND button on a PDF I was sending around in the required manner.

How did I do it?

I added a button into my mail and dumped a chunk of code which uses the windows ShellExecute API call into the lotusscript section.

I looked around the notes client to see if there was a new way (like that wonderful new way of adding web links). Nope... I couldn't see anything.

I tried Create as hotspot... it spat the dummy about spaces in the file path.

I enclosed in quotes and tried again... this time it almost worked. I changed the beginning of the path to "file://" and it worked - but of course I know that some browsers won't accept file:// urls for security reasons.

I'm none the wiser.

I did a web search and found the following;

A set of instructions...

Nope... I'm not telling my users to do that. It's too hard and I'd rather tell them that they can't do it. Try again.

An External Application

You're kidding right? I mean, kudos to the guys who found an empty market niche but there's no way I'm going to accept that we need to install a third party app for this. It should be built in. In any case, the application does a sort of manual DAOS (Domino attachment and object service). It still stores the attachment in a second place - inside a database in the notes/domino system.

My Code
I guess I should make my button code available for everyone - well, everyone who has a designer client - so, not the majority of my users...

1. Add a button.
2. Change it to Run on Client - LotusScript
3. In the declarations section put this code...

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (Byval hwnd As Long, Byval lpOperation As String, Byval lpFile As String, Byval lpParameters As String, Byval lpDirectory As String, Byval nShowCmd As Long) As Long

Declare Function GetDesktopWindow Lib "user32" () As Long


4. Create a new subroutine as follows;

Sub RunShellExecute(sTopic As String, sFile As Variant, sParams As Variant, sDirectory As Variant, nShowCmd As Long)
'EXAMPLE: Play wav file with associated app RunShellExecute "Play", "c:\windows\media\Notify.wav", 0&, 0&, SW_SHOWNORMAL
'EXAMPLE: Play avi file with associated app RunShellExecute "Play", "E:\VB Graphics\avi\Cogs.avi", 0&, 0&, SW_SHOWNORMAL
'EXAMPLE: Open txt file with associated app RunShellExecute "Open", "c:\My Documents\rundll.txt", 0&, 0&, SW_SHOWNORMAL
'EXAMPLE: Open txt file with notepad RunShellExecute "Play", "C:\windows\notepad.exe", "c:\My Documents\rundll.txt", 0&, SW_SHOWNORMAL
Dim hWndDesk As Long
Dim success As Long
Const vbTextCompare = 1
Dim HashPos As Integer
HashPos = Instr(1, sFile, "##" , vbTextCompare)
If HashPos > 0 Then
sTopic = Left(sFile, HashPos -1 )
sFile = Right(sFile, (Len(sFile) - (HashPos+1)))
End If
'The desktop will be the default for error messages
hWndDesk = GetDesktopWindow()
Print "RunShellExecute: " + "Topic=[" + sTopic + "]" + " File=[" + sFile + "]"
'Execute the passed operation
success = ShellExecute(hWndDesk, sTopic, sFile, sParams, sDirectory, nShowCmd)
End Sub

5. Write the click routine as follows; (with the LaunchPath pointing to your file).

Sub Click(Source As Button)
Const LaunchPath = "L:\Videos\IT\Hacking Fraud Example.avi"
RunShellExecute "Open", LaunchPath, 0&, 0&, SW_SHOWNORMAL
End Sub

There.... Easy! ... erm... not.

The new Domino attachment and object service helps a lot in this regard. It only stores the attachment once - and without any user-intervention. It's almost a solution but not quite.

You see, in this day and age, we often want to make video and audio recordings of our conferences available to our internal staff without having to store even a single copy on our mail server. After all, sometimes these recordings are several gigabytes because the conferences can last for days.

Sometimes we just want to point people to a particular folder and not to file.

No Answer?
Well, that's it from me. I've been using Notes/Domino for longer than I was at school and yet I still don't know an easy way to send a link to a file.

Has anyone out there got any ideas?


Brownie said...

Do you use Quickr? If so you can send a link to an attachment stored in quickr by drag and drop. Or when a user emails an attachment the Quickr Connector can ask if they want to file it into a quickr and then send a link only.

Michelle said...

What version of Notes are you using? With Notes 8.5.1 (possibly earlier) you can use the Link button in the toolbar and just paste the file path into the dialog box. Mapped paths work (G:\Shared\My Folder\mydocumnt.docx). If you want to use a UNC path, prepend the FILE protocol (file:\\myserver\
share\folder\doc). Works on both Windows XP and Windows 7 - haven't tried it on Linux or Mac.

For older version of notes, create a link hotspot with with the file: protocol and full UNC path. Better yet - create a database to store attachments and send Notes doclinks.

Chris Toohey said...

Hey Gavin,

Since you're not adverse to using code to solve the problem, what about leveraging a Microsoft Web Browser Embedded Object Control?

I wrote a proof of concept a while back called "Sorting Hat" (http://www.dominoguru.com/pages/sortinghat_v0.1.html).

Demos here: http://www.dominoguru.com/pages/sortinghat_demo.html

The idea is pretty simple: you define the OS directory as part of the NotesDocument (via a NotesItem). You then wire the control to the NotesItem, and now you have an embedded mini-Windows Explorer.

Just a thought!


Albert Buendia said...

Hi Gavin,

Only as a suggestion. Using the hiperlink button of the toolbar it seems it works fine.

1) Write some words, i.e. "Link to the file"
2) Select the text and click onto the hyperlink button.
3) Paste the file link directly, i.e. h:/docs/file.doc (use the "right" slash not the backslash)
4) Send to te right person.

Tested on Notes 8.5.1

Hope it can help you.

Anonymous said...

Let me lead with I hate lotus notes more than any other software I have ever used.

Here is the built-in solution and I verified it works. Create a hyperlink and instead of URL use: file://///server/share/path to folder/

My need was to send a link to a folder and not a file.


Gavin Bollard said...


The file:// solution works well and it's my go-to method of choice. I'd like an easier method for my users but clearly that's not going to happen - and since the days of Windows seem to be declining, it may no longer be a problem in the future.

I understand that many people hate Notes. I love it and I use it for many things, mail being the very LEAST of these.

The future of Notes is web but sadly most domino apps I've seen aren't designed for the web, just tweaked for it. Domino is still the most powerful and versatile end-user system I've ever seen.

It's just a pity that the current people at IBM lack the vision to see the clear path ahead.