Multiple Documents links in compose memo

Hi,

I want to create the links of selected documents in new memo (compose command) through lotus notes script. Formula only create doclink of currently selected document (not the multiple docs).


Sample code

Dim ws As New NotesUIWorkspace

Dim session As New NotesSession

Dim uiview As NotesUIView

Dim dc As NotesDocumentCollection

Dim doc As  NotesDocument

Dim cdoc As NotesDocument

Dim currdb As NotesDatabase



Dim uidoc As NotesUIDocument

Dim rtitem As NotesRichTextItem 

Dim rtitem2 As NotesRichTextItem 	

Dim CopyDoc As NotesDocument 

Dim mdoc As NotesDocument 

	



Set currdb=session.CurrentDatabase



Set uiview = ws.CurrentView

Set dc = uiview.Documents

Set cdoc = dc.GetFirstDocument



While Not (cdoc Is Nothing)



MailDb  = Evaluate("@MailDbName")



Set CopyDoc= New NotesDocument (CurrDb)



Set rtitem = New NotesRichTextItem( CopyDoc, "Body" )



Call rtitem.AppendDocLink( cdoc, Currdb.title )

Call  rtitem.Appendtext ( "  >> ")

Call rtitem.AddNewLine(3)

	



Set uidoc = ws.ComposeDocument ( MailDb(0), MailDb(1), "Memo" )

	



Set uidoc = ws.CurrentDocument

Set mdoc=uidoc.Document 



Call uidoc.save

	

Set rtitem2 = mdoc.GetFirstItem( "Body" )



Call rtitem2.AddNewLine(1)

Call rtitem2.AppendRTItem( rtitem)

Call rtitem2.AppendText ("afasfasf")



Call mdoc.Save(False, True)







	Set doc = dc.GetNextDocument (cdoc)





Wend

End Sub


But somehow it not working. Is there any solution or sample code to do the above mentioned task.

Thanks. Imtiaz

Subject: Multiple Documents links in compose memo

If you used your code in an agent with “unprocesseddocuments” collection, this works fine.