Monday, March 13, 2006

Development Question: devWorks Posting With No Replies

The other day I posted the following at devWorks. I haven't had any replies so I thought I would post it here too.

I am in the process of setting up mail archives. I want to send a button to users that will create a Bookmark Bar Icon directly to the DB (by the way, does anyone know how to do this without restarting Notes to make the icon display?).

After my test users try opening the Bookmark Bar Icon, they get the error "Server Error: File Does Not Exist". If I have them go through the Tools > Archive > Open from their Mail navigation frame, the database will open. Then I can have them click the Icon and it will now work. Magic? What's going on with this? Below is my code - you can see that the code traps for the database not being found and can only build the Bookmark if it finds the correct database! I swiped most of the code from another post on the forum. :) Thanks in advance!


Sub Click(Source As Button)
Dim outline As NotesOutline
Dim NewOE As NotesOutlineEntry
Dim s As New NotesSession
Dim db As NotesDatabase
Dim curdb As NotesDatabase
Dim archdb As NotesDatabase
Dim curdbname As String
Dim arcdbname As String
Dim archid As String

On Error Goto ErrHandle
Set db = New NotesDatabase( "", "bookmark.nsf" )
Set outline = db.GetOutline("UserBookmarkOrder")
Set curdb = s.CurrentDatabase
curdbname = Strright(curdb.FilePath,"\")
archdbname = "FASmail\a_" + curdbname
Set archdb = s.GetDatabase("TPDOMINO1/COMPORIUM", archdbname)
archid = archdb.ReplicaID

Set NewOE = outline.CreateEntry("Mail Archive")
Call NewOE.SetURL( "notes://tpdomino1/" + archid )

NewOE.ImagesText = "Link - Notes Database"

Call outline.save()
Msgbox "Bookmark Created Successfully - Please Restart Lotus Notes To View"
Goto ExitSub

ErrHandle:
Msgbox "An error occurred while adding the bookmark. Please call the Help Desk for support."
Resume ExitSub

ExitSub:
End Sub


This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.


Now Playing: "Insectsamongus" by Jordan Rudess

No comments: