Suggestion: Need LotusScript method for "NotesRichTextItem.AppendHotSpot"

A LotusScript NotesRichTextItem method is needed for a “AppendHotSpot”. Currently, API exist for AppendText, AppendDocLink, and many other items, but not for appending a HotSpot that points to a URL.

Use case: Creating a complex document via LotusScript that contains dozens, hundreds or even thousands of URL links to web based resources. For example, the following table was created via LotusScript. The first two columns should be URL links that point to the live data for these records. Since the URLs are very long, it is impractical and confusing to simply provide the full URL into the document. In other words, the usage needs to be very similar to an HTML anchor i.e. text where only the text is visible.

Universal ID

CMVC ID

State

Severity

Age

Platform

Subsystem

Component

ReportedRelease

Track

Releasename

Fix Potential

Headline

Projected Date

Owner

Dept

FW123456

987655

Working

2

172

project1_all

abc

ccmm

eFW3.4

approve

abc340

F341R

abstract text 1

2008-12-02

user1@us.ibm.com

XYZ1

FW234567

098765

Working

2

2

project2_all

abc

ccmm

eFW3.4

approve

abc340

F341R

abstract text 2

2008-12-02

user2@us.ibm.com

XYZ1

Subject: Suggestion: Need LotusScript method for “NotesRichTextItem.AppendHotSpot” (ok… that did not work)

I tried using the Notes Toolkit… but this only updates a new notes item. Does anyone know how to modify this in the context of BodyRichTextItem.BeginInsert(BodyRichTextNavigator) and EndInsert within an existing Body rich text item?

This only creates a new item.

Dim memPtr As Long

Dim memLen As Long

Dim memhandle As Long

Const TYPE_HTML = 21

Const ITEM_SIGN = &H0001

Declare Function NSFItemAppend Lib “nnotes” (Byval noteHandle As Long, Byval iFlags As Integer,Byval iName As Lmbcs String,_

Byval iNameLength As Integer, Byval iType As Integer, Byval iValuePointer As Long, Byval iValueLength As Long) As Integer

Declare Function OSMemAlloc Lib “nnotes” (Byval T As Integer, Byval S As Long, hM As Long) As Integer

Declare Function OSMemFree Lib “nnotes” (Byval hM As Long) As Integer

Declare Function OSLockObject Lib “nnotes” (Byval H As Long) As Long

Declare Sub OSUnlockObject Lib “nnotes” (Byval H As Long)

Declare Sub Poke Lib “kernel32” Alias “RtlMoveMemory” (Byval P As Long, Byval D As Lmbcs String, Byval N As Long)

Sub Initialize

  Dim s As New notessession

Dim db As notesdatabase

Dim doc As notesdocument

Dim html As String

Dim itemname As String

Dim memPtr As Long

Dim memLen As Long

Dim memhandle As Long



Dim rc As Integer



Set db = s.currentdatabase

Set doc = db.createdocument



doc.form = "Memo"

doc.Subject = "Email with URL Hotspot"



Dim recipients( 1 To 2) As String

recipients( 1 ) = "user1@us.ibm.com"

recipients( 2 ) = "user2@us.ibm.com"



itemname = "Body"

html = |<a href="http://server.domain.com/cgi-bin7/defectview?entity=691480">691480</a>|



memLen = Len(html)



rc = OSMemAlloc( 0, memLen, memHandle)

memPtr = OSLockObject(memHandle)            



Poke memPtr, html, memLen

rc = NSFItemAppend( doc.handle, ITEM_SIGN , itemname, Len(itemname), TYPE_HTML, memPtr, memLen)



OSUnlockObject memHandle

OSMemFree memHandle



Call doc.send(False, recipients)

End Sub

Subject: Help!!! Suggestion: Need LotusScript method for “NotesRichTextItem.AppendHotSpot”

I am still looking for a solution to this challenge. I have tried a couple of solutions, but none scale to large tables, and none of the solutions I have tried work with BodyRichTextItem.BeginInsert(BodyRichTextNavigator).

Any and all suggestions welcome!!! Thanks in advance for any guidance.