Tuesday, March 21, 2006

Update On Last Week's Bookmark Bar Question

Last week I posted a question about a "Server Error: File Does Not Exist" error I was receiving when sending out a link for users to automatically create a Bookmark Bar icon.

Here is my code that works (except for not being able to create the icon without restarting the Client). Basically, I added:

Dim ws As New NotesUIWorkspace
Call ws.OpenDatabase("TPDOMINO1/COMPORIUM" , archdbname)

This will force the database to be opened after creating the bookmark. Since I also moved my archive folder, I have been able to test this out with some people and it worked. I should be getting my RedHat xSeries this week that I will use for the production archive server. By the way, apologies to David Jones if this code isn't properly annotated! ;)

Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
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 archdbname 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 = "archive\a_" + curdbname
Set archdb = s.GetDatabase("TPDOMINO1/COMPORIUM", archdbname)
archid = archdb.ReplicaID

Call ws.OpenDatabase("TPDOMINO1/COMPORIUM" , archdbname)

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 See Icon on Bookmark Bar"
Goto ExitSub

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

End Sub

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

Now Playing: "Animate-Inanimate" by John Petrucci

No comments: