Set ctx = New rtContainer
Call ctx.getRichTextItem(doc,"Body")
Dim range As rTextRange,start As rtObject, anchor As rtAnchor, link As rtNoteLink
Dim hrule as new rtHRule (0)
Set range = ctx.Find("Caesar", 0)
If Not range Is Nothing Then
 Set anchor = New rtAnchor("Caesar")
 Print "SET ANCHOR"
 range.Collapse(nxCollapseStart).Insert anchor
End If
Set link = New rtNoteLink(doc) ' point to this document - may use DB or view instead
' link.setSource doc  ' may also set source separately; source can be also database or view
link.Anchor = "Caesar"
link.Comment = "Going after Caesar" ' put any comment - without it the Anchor link won't work
ctxDump.add hrule
With hrule
 .NotesColor = COLOR_RED
 .RuleWidth = 10*ONE_CM
 .RuleHeight = 0.2 * ONE_CM
End with
ctx.replaceItemValue doc, "Body" ' replace in this document
doc.save True, True
' this will be in the new document
ctxDump.appendText "This will take you to Ceasar: "
ctxDump.Add link
|