Hi,
I’m trying to insert in a RT Field, a doclink to a database. I have the right information in my current form (File server & File path).
Everything seems ok when I run the script step by step, but at the end, the field is still empty …
I tried to send this doclink by mail, this way worked perfectly.
I think I missed something, but I don’t know what … !
This is the scripts I created :
1/ My “Save” action :
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim Doc_Current As NotesUIDocument
Set Doc_Current = workspace.CurrentDocument
Call Paste_DbLink(Doc_Current.Document)
Call Doc_Current.Save
Call Doc_Current.close(True)
End Sub
2/ My Script to insert the doclink
Sub Paste_DbLink(Doc_Source As NotesDocument)
Dim session As New NotesSession
Dim Target_Db As NotesDatabase, Current_Db As NotesDatabase
Dim RTItem As NotesRichTextItem
Set Target_Db=session.Getdatabase(Doc_Source.MailServer(0),Doc_Source.MailFile(0))
Set Current_Db=session.CurrentDatabase
Print "File Server : " +Doc_Source.MailServer(0) + Chr$(10)+"Path file : "+Doc_Source.MailFile(0) + Chr$(10)+"Db Title : "+ Target_Db.title
Set RTItem = New NotesRichTextItem(Doc_Source, “DbLink”)
Call RTItem.AppendDocLinkTarget_Db,Target_Db.Title)
Call Doc_Source.save(True,True)
End Sub
If someone has a idea about what is wrong, I’d appreciated.
Thanks.
Sylvain