Friday, August 18, 2017

The Notes UI and Sending a Link to a File

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 youre doing your best. The same goes for the blackberry team. I know that theyre doing their best too. Its 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.

Hes already cleverly tried attaching the .LNK file, but our policies dont allow that as its considered to be an executable file.

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

Its 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 couldnt 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 wont accept file:// urls for security reasons.

Im none the wiser.

I did a web search and found the following;

A set of instructions...
http://en.allexperts.com/q/Using-Lotus-Notes-1427/send-link-via-Lotus.htm

Nope... Im not telling my users to do that. Its too hard and Id rather tell them that they cant do it. Try again.

An External Application
http://www.virtualobjectives.com.au/notesdomino/linkhotspot.htm

Youre kidding right? I mean, kudos to the guys who found an empty market niche but theres no way Im 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

CONSTANTS
Const SW_SHOWNORMAL = 1
Const SW_SHOWMAXIMIZED = 3
Const SW_SHOWDEFAULT = 10

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:windowsmediaNotify.wav", 0&, 0&, SW_SHOWNORMAL
EXAMPLE: Play avi file with associated app RunShellExecute "Play", "E:VB GraphicsaviCogs.avi", 0&, 0&, SW_SHOWNORMAL
EXAMPLE: Open txt file with associated app RunShellExecute "Open", "c:My Documents undll.txt", 0&, 0&, SW_SHOWNORMAL
EXAMPLE: Open txt file with notepad RunShellExecute "Play", "C:windows otepad.exe", "c:My Documents undll.txt", 0&, SW_SHOWNORMAL
Dim hWndDesk As Long
Dim success As Long
Const SE_ERR_NOASSOC = &H31
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:VideosITHacking Fraud Example.avi"
RunShellExecute "Open", LaunchPath, 0&, 0&, SW_SHOWNORMAL
End Sub


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


DAOS
The new Domino attachment and object service helps a lot in this regard. It only stores the attachment once - and without any user-intervention. Its 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, thats it from me. Ive been using Notes/Domino for longer than I was at school and yet I still dont know an easy way to send a link to a file.

Has anyone out there got any ideas?


download file now