Solved

Sending a doc link using LotusScript

Posted on 2000-04-17
1
824 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
ID: 2723275
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

25 Experts available now in Live!

Get 1:1 Help Now