Formatting a DocLink (in RichTextItem)

In a rich text field (called “Link”), I’m creating a docLink as text hotspot (doc.Title(0)) using the following script…

Dim workspace As New NotesUIWorkspace

Dim doc As NotesDocument

Dim rtitem As Variant

Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document

Set rtitem = doc.GetFirstItem( “Link” )

Call rtitem.AppendDocLink(doc, “Link to the document”, doc.Title(0))

Call doc.Save( False, False, False )

I have 2 questions:

First, is there a way to modify this script to get rid of the box that displays around the hotspot?

Second, is there a way to “overwrite” whatever might be in that rich text field to begin with (instead of appending)? I think the BeginInsert method in RichTextItem might do this, but I can’t figure out what to use for the “element” parameter.

Subject: Formatting a DocLink (in RichTextItem)

Hi Mark,

this is, how I empty the RT field:

Clear the history in the history field. To clear the field, first delete it and create from scratch

While doc.HasItem(RTFieldName)

Call doc.RemoveItem(RTFieldName)

Wend

Then create the history field from scratch

Set rtitemHistory = doc.CreateRichTextItem(RTFieldName)

Hope this helps,

Juraj

Subject: RE: Formatting a DocLink (in RichTextItem)

Thank you, Juraj! That works great!

Subject: Formatting a DocLink (in RichTextItem)

What about this:

set doc.link = “”

Shawn