Hi, I am having this problem
I have a database that creates a link to a document when certain variables are filled, well for some reason this link only works when the database is bookmarked. I test it and if I delete the bookmarked from the workspace and press the link a message appears telling that document doesn’t exist, if I bookmark the db everything works perfect.
Can I use this function Opendatabase associated with the link ?
Thanks in advance
Here is the code for the link
Sub Click(Source As Button)
Dim session As New notessession
Dim db As notesdatabase
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim L_Doc As NotesDocument
Dim doc As notesdocument
Dim rtitem As NotesRichTextItem
Set db = session.currentdatabase
Set uidoc = workspace.CurrentDocument
Set L_Doc = uidoc.Document
Call L_Doc.Save(True,False)
For i=0 To Ubound(L_Doc.GetItemValue("SendTo"))
Set doc = New notesdocument(db)
Set rtitem = New NotesRichTextItem( doc, "Body" )
Call rtitem.AppendText(L_Doc.GetItemValue("remarks")(0))
Call rtitem.AddNewLine( 1 )
Call rtitem.AddNewLine( 1 )
Call rtitem.AppendText("Please follow this link")
Call rtitem.AddNewLine( 1 )
Call rtitem.AddNewLine( 1 )
Call rtitem.AppendDocLink( L_Doc, db.Title )
doc.form= "memo"
doc.sendto = L_Doc.GetItemValue("SendTo")(i)
doc.subject = "Issue - no. " + uidoc.FieldGetText("no") + " - " + uidoc.FieldGetText("o_headline")
doc.Body= "Please follow this link"
Call doc.send(False)
Next
End Sub