rtLib — Notes Rich Text Management Library Documentation of rtLib — Notes Rich Text Management Library Download rtLib — Notes Rich Text Management Library FAQ of rtLib — Notes Rich Text Management Library Purchase rtLib — Notes Rich Text Management Library Feedback about rtLib — Notes Rich Text Management Library

Cookbook

Insert text/object in particular place

Start search Mail feedback Back to Description


rTextRange rtGraphic

Collapse Find getRichTextItem Insert

Code fragment from sample "Insert text/object in particular place"; see full running samples in downloadable help.
Call ctxDump.getRichTextItem(doc,"Body")

if ses.platform = "Macintosh" then
path = strLeft(ndb.FilePath,":") + ":"' default place(?) where it stores things without path (exported to in export sample)
Else
path = Environ("TEMP")
if
path<>"" then path = path + "\"' it's a W32 client
End if

Dim
r As rTextRange
Dim picture As New rtGraphic(path &"flagDE.jpg")

' once we find the significant text we receive back rTextRange object that can be used to insert either text or other object
'Set r =ctxDump.Find ("where",0).Collapse(nxCollapseStart)
Set r =ctxDump.Find ("where",0).Collapse(nxCollapseEnd)

r.Insert " Exstructis tandem navibus et in altum provectis, Aeneas cum sociis in Thraciam defertur. "
set r = ctxDump.Find ("altum",0).Collapse(nxCollapseEnd)
r.insert picture

Set r =ctxDump.Find ("where",0)
r.insert "#where was here#" ' over "where"