Multiple doc links in compose memo command in LotusScript

Hi,

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

does anyone has sample code for this.

Subject: Multiple doc links in compose memo command in LotusScript

From the R5 online Designer Help:

  1. This script creates a new mail memo. In the Body item of the memo, the script places a link to each document in the Boots folder in the test.nsf database. Each link is followed by a tab, the Subject item of the document being linked to, and a carriage return.

Dim session As New NotesSession

Dim db As New NotesDatabase(“”, “test.nsf”)

Dim view As NotesView

Dim newDoc As NotesDocument

Dim rtitem As NotesRichTextItem

Dim doc As NotesDocument

Set view = db.GetView( “Boots” )

Set newDoc = New NotesDocument( db )

Set rtitem = New NotesRichTextItem( newDoc, “Body” )

Set doc = view.GetFirstDocument

While Not ( doc Is Nothing )

Call rtitem.AppendDocLink( doc, db.Title )

Call rtitem.AddTab( 1 )

Call rtitem.AppendText( doc.Subject( 0 ) )

Call rtitem.AddNewLine( 1 )

Set doc = view.GetNextDocument( doc )

Wend

newDoc.Subject = _

“Here are links to all docs in the Boots folder”

newDoc.SendTo = “Lauri Nodwell”

Call newDoc.Send( False )

Subject: RE: Multiple doc links in compose memo command in LotusScript

Thank alot for the reply Coni,

Actually i am looking to do this by using “Compose” Memo command. I had an idea of this.

Any other clue or help.

Subject: Multiple doc links in compose memo command in LotusScript

A Bit late this time, but here is my first cut for future reference :

Dim uiws As New notesuiworkspace

Dim s As New NotesSession

Dim db As NotesDatabase

Dim mailDB As NotesDatabase

Dim mailDoc1 As NotesDocument

Dim mailDoc2 As NotesDocument

Dim uiDoc As NotesUIDocument



Dim rtItem As NotesRichTextItem

Dim dc As NotesDocumentCollection



On Error Goto Bail



Set db = s.CurrentDatabase

Set dc = db.UnprocessedDocuments

If dc.Count = 0 Then

	Messagebox "No documents selected.  Please select a document you wish to forward.", 0+32+0+0, "Warning"

	Goto theEnd

End If

Set mailDb = New NotesDatabase("", "")	

Call mailDB.OpenMail

Set mailDoc1 = New  NotesDocument(mailDb)

Call mailDoc1.ReplaceItemValue("Form", "Memo")

Set rtItem = New notesRichTextItem(mailDoc1, "Body")

Call rtItem.AddNewline(3,True)





Set doc = dc.GetFirstDocument

While Not doc Is Nothing

	

		Call rtItem.AppendText("Click on doclink to view live tracking document (" &  doc.GetItemValue("Form")(0) & ") -->		")

		Call rtItem.AppendDocLink(doc,  doc.GetItemValue("Form")(0), "")

		Call rtItem.AddNewline(1, True)

	

	

	Set doc = dc.GetNextDocument(doc)

Wend



Call mailDoc1.Save(False, False, False)

Set mailDoc2 = New NotesDocument(mailDb)

Call mailDoc1.CopyAllItems(mailDoc2, True)

Call mailDoc1.Remove(True)

Set uiDoc = uiws.EditDocument(True, mailDoc2, False,"",True,True)

theEnd:

Exit Sub

Bail:

Messagebox "Error(" & Cstr(Err) & "):  " & Error$ & ", at line " & Cstr(Erl) & ".", 0+16+0+0, "Error"

Goto theEnd