Adding doc link to doc.send

Hi, I need help adding to the the existing script, shown below, which would send an email that includes a doc link to the newly created document. The code is not mine, I really don’t know script, I usually use @MailSend with [IncludeDoclink].

Thanks, Paul


Sub Click(Source As Button)

'Create Socket from Config # 1

Dim session As New NotesSession

Dim db As NotesDatabase

Dim workspace As New NotesUIWorkspace

Dim collection As NotesDocumentCollection

Set db=session.CurrentDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument	

Set uidoc=workspace.CurrentDocument

Set doc=uidoc.Document

Dim newdoc As NotesDocument	



Set collection = workspace.PickListCollection(1,False, "D01DBR06/01/A/IBM","s_dir\sockets1.nsf","9. Admin\Available Blank Forms\Sockets","Available Order Numbers","Please select an Order Number.")



	Set newdoc = collection.GetFirstDocument

	

	newdoc.Form = "AddSocket 3.0"



	***???NEW SEND EMAIL CODE???***

	

	Call newdoc.Save(True,True)

	Call workspace.editDocument(False,newdoc)

	Call workspace.EditDocument(True)

End If	

End Sub

Subject: Here is the example straight from Domino Designer Help

Basically you need to create the Body field as RichText and then append the doclink from the doc you want.

This script creates a new NotesRichTextItem called “Body” on a mail memo. It uses the AppendDocLink method to place a doclink to the current document in the Body, and the Send method to mail the memo to Frank Glennel.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim memo As NotesDocument
Dim rtitem As NotesRichTextItem
Set db = session.CurrentDatabase
'…set value of doc…
Set memo = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( memo, “Body” )
Call rtitem.AppendDocLink( doc, db.Title )
memo.Subject = “Here’s a link to the document”
Call memo.Send( False, “Frank Glennel” )

Subject: Perfect, Thanks!!!

Hi Carl,

Thanks for taking the time to help me! I had to make one minor tweak changing the “doc, db.Title” to “newdoc, db.Title”.

Anyway, truly appreciate the assistance.

Take care, Paul

Subject: Post your code.