Solved

Sending a doc link using LotusScript

Posted on 2000-04-17
1
965 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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