I wanted to be able to get the url for the current document(s) in my mail database so I could paste them in another application and then click on the URLs to access the original messages directly from within that other app as needed.
I cobbled together a little LotusScript agent that grabs the NotesURL from each document and then scrubs out that junk that Lotus includes for no discernible reason.
So
notes://NotesServer@mydomain/__85256EDA00695075.nsf/0/EEF8D00A7E50A458852573BE0069A402?OpenDocument
becomes
notes://NotesServer/85256EDA00695075/0/EEF8D00A7E50A458852573BE0069A402?OpenDocument
This script will show the result in a messagebox. I also have it insert the URL into the clipboard for me but I’ve scraped that out so as not to confuse the issue.
It’s not as pretty as I’d like, but this should help others trying to get a useful URL out of Lotus’ terrible implementation.
Dim sess As New NotesSession
Dim doc As NotesDocument
Dim coll As NotesDocumentCollection
Dim sTempURL As String
Dim sURL As String
Dim iPosAT As Integer
Dim iPosSlashUnderscores As Integer
Dim iPosNSF As Integer
Set coll = sess.CurrentDatabase.UnprocessedDocuments
Set doc = coll.GetFirstDocument
sURL = “”
While Not doc Is Nothing
sTempURL = doc.NotesURL
iPosAT=Instr(sTempURL,”@”)
iPosSlashUnderscores = Instr(sTempURL,”/__”)
iPosNSF = Instr(iPosSlashUnderscores+1,sTempURL,”.nsf/”)
If sess.CurrentDatabase.Server=”" Then
sTempURL = Left$(sTempURL,8) & “/” & Mid$(sTempURL,iPosSlashUnderscores+3,iPosNSF-iPosSlashUnderscores-3) & Mid$(sTempURL,iPosNSF+4)
Else
sTempURL = Left$(sTempURL,iPosAT-1) & “/” & Mid$(sTempURL,iPosSlashUnderscores+3,iPosNSF-iPosSlashUnderscores-3) & Mid$(sTempURL,iPosNSF+4)
End If
sURL = sURL & sTempURL
Set doc = coll.GetNextDocument(doc)
If Not doc Is Nothing Then
sURL = sURL & Chr$(13)
End If
Wend
If sURL = “” Then
Messagebox “No Documents Selected”,0,”Nothing to do”
Else
Messagebox sURL,0,”URL(s) for selected docs”
End If
(also posted in http://www-10.lotus.com/ldd/nd6forum.nsf/ShowMyTopicsAllFlatweb/9324f9e90784fbd5852573be0071f311?OpenDocument)

Related Posts:
- Old Reminders Keep Appearing for Recurring Meetings
- In Lotus Notes, a user has recurring meetings scheduled. When the reminder comes up, they...
- If you make it more efficient, people will use more of it
- It’s just human nature. It’s not a bad thing, but it *is* something that we...
- Landscaping our property – The Beginning
- A little while ago we had a landscape architect (Sherry Lizotte) come over and create...
- Landscaping our property – Ongoing 1
- Here are some shots after the work began. Here is the front of the house...
- Excessive force in protecting one’s guests and property?
- Gatecrashers flee whip-wielding dad – National – smh.com.au This reminds me of Canada’s idiotic “Excessive...
Posted under Lotus Domino, Work Portfolio
This post was written by Marc
on December 31, 2007 at 1:49 pm




You do not even need the servername – just use notes:///85256EDA00695075/0/EEF8D00A7E50A458852573BE0069A402?
All Notes links do not realy use the servername – If you have a replica on another server it might as well be accessed.
Regards,
Hans Holt
Thanks Hans, I’ll have to give that a try. I thought that, if you did not have a replica on your workspace, it would come back and prompt you for the server.