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...
- Create a local replica of your mail file using LotusScript
- I recently had the need to create local mail file replicas for a bunch of...
- Autoresponder LotusScript
- Below is code to create an automated response whenever someone sends a message to a...
- Cure for Public / Private key mismatch in Lotus Notes
- A fairly common problem in Domino / Lotus Notes is to have a mismatch between...
- Winmail.dat file issue in Lotus Notes workaround (finally)
- From the timestamps I see that this gem has been available since June of 2006...
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.