Doclinks on a picture in a richtext field

Hi everyone!

I have started using the NotesRichTextDoclink class in order to programmatically find and modify doclinks in a richtext field. This works fine for normal doclinks in text. However, I haven’t found a way to find and modify doclinks that are placed on a picture that is embedded into the field. These doclinks are created using hotspots. Has anyone encountered this before? Perhaps with a solution to the problem?

Regards,

Oscar Johnson

Subject: RE: Doclinks on a picture in a richtext field

The following code seems to work pretty well for me, reporting information about the link on the image below. I’m using version 7:

Dim wksp As New notesuiworkspace

Dim uidoc As notesuidocument

Dim doc As notesdocument

Dim rti As NotesRichTextItem

Dim nav As NotesRichTextNavigator

Dim link As NotesRichTextDoclink

Set uidoc = wksp.CurrentDocument

uidoc.Refresh True

Set doc = uidoc.Document

Forall item In doc.Items

	If Typename(item) = "NOTESRICHTEXTITEM" Then

		Set rti = item

		Set nav = rti.CreateNavigator

		Set link = nav.GetFirstElement(RTELEM_TYPE_DOCLINK)

		If link Is Nothing Then

			Print rti.name & ": no links found"

		Else

			Print rti.name & ": " & link.DBReplicaID

		End If

	End If

End Forall

Subject: RE: Doclinks on a picture in a richtext field

Hi! And thanks for the quick answer!

I tried your code (I’m using version 6.5.3), but couldn’t get it to work. Maybe I need to clarify my problem a little. The thing is, I need to find the links placed upon the picture using hotspots, for instance rectangle hotspots. Is this how you did? Then maybe the issue is solved in R7, and I just have to wait for the gold release…

If I place the whole picture in a hotspot (using Create - Hotspot - Link hotspot) it works just fine, but that is not what I want to accomplish.

Regards,

Oscar

Subject: Won’t work for rectangle hotspots or other hotspots other than default hotspot

I don’t know whether it will work in ND7, but in ND6/6.5, the

nav.GetFirstElement(RTELEM_TYPE_DOCLINK)

will only find doclinks that are implemented as SIG_CD_LINK2 or SIG_CD_LINKEXPORT2, whereas the area elements (rectangle hotspots) are implemented solely as SIG_CD_HREF records. The default hotspot is the one exception.

It may be that this has been extended or can be extended for ND7, but in ND6 you might need to go with DXL or a third party product such as our Midas Rich Text LSX, which would find the image map hotspot and let you query and/or manipulate it.