Solved

Sending a doc link using LotusScript

Posted on 2000-04-17
1
814 Views
Last Modified: 2013-12-18
Hi,

How can I send an e-mail message that includes a doc link using Lotus Script?

Thanks,

Zaphod.
0
Comment
Question by:Z_Beeblebrox
1 Comment
 

Accepted Solution

by:
sideshowbob earned 30 total points
Comment Utility
These are the examples from Notes Help (search for 'AppendDocLink').

1. This script creates a new mail memo. In the Body item of the memo, the script places a link to the current database.
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( db, db.Title )
newDoc.Subject = "Here is a link to the database"
newDoc.SendTo = "Lauri Nodwell"
newDoc.Send( False )

2. This script creates a new mail memo. In the Body item of the memo, the script places a link to the Boots folder in the current database.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Set db = session.CurrentDatabase
Set view = db.GetView( "Boots" )
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Call rtitem.AppendDocLink _
( view, view.Name & " in " & db.Title )
newDoc.Subject = "Here is a link to the Boots folder"
newDoc.SendTo = "Lauri Nodwell"
Call newDoc.Send( False )

3.This script creates a new mail memo. In the Body item of the memo, the script places a link to the first document in the Boots folder in the current database.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView( "Boots" )
Set newDoc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( newDoc, "Body" )
Set doc = view.GetFirstDocument
Call rtitem.AppendDocLink _
( doc, doc.Subject( 0 ) & " in " & view.Name )
newDoc.Subject = _
"Here is a link to first document in the Boots folder"
newDoc.SendTo = "Lauri Nodwell"
Call newDoc.Send( False )

4. 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 current 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 NotesDatabase
Dim view As NotesView
Dim newDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim doc As NotesDocument
Set db = session.CurrentDatabase
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 )

I also have this sample script that, when executed (in this case, via a button's click event), generates a mail memo to a particular recipient with an attached doclink that points back to the original document.
*Note: In order for this script to run properly, the original document must be saved before the script is executed.

Sub Click(Source As Button)
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 = "A Recipient"
newDoc.Send( True )

End Sub
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now