Hi,
how to compose a new mail memo which automatically contains a doclink to the current document from an action button?
Hi,
how to compose a new mail memo which automatically contains a doclink to the current document from an action button?
Subject: Example…
@Command(FileSave]);@Command(ToolsRunMacro]; “AgentToSend”)
This is the code for your agent:
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim session As New NotesSession
Dim db As NotesDatabase
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Set db = session.CurrentDatabase
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem(newDoc, "Body" )
Call rtitem.AppendDocLink(doc, "TEST" )
newDoc.Subject = "Here is a link to the document"
newDoc.SendTo = "Your Name"
newDoc.Send( True )
or
Dim session As New NotesSession
Dim db As notesdatabase
Dim doc As NotesDocument, memo as NotesDocument
Dim rtitem As NotesRichTextItem
Set db = Session.CurrentDatabase
Set doc = session.DocumentContext
set memo= New NotesDocument(db)
'Print "<H2>" + doc.Description(0) + "</H2>"
memo.form="Memo"
memo.SendTo = "Your Name"
memo.Subject = "Testing"
' doc.body="Here's the mail from the web."
set rtitem = New NotesRichTextItem(memo, "Body")
Call rtitem.AddNewLine(1)
Call rtitem.Appendtext("Click here to launch the document
-->")
Call rtitem.AppendDocLink(doc,"Title")
Call memo.Send( False )