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

Replace attachment icon

Start search Mail feedback Back to Description


rtAttachment rtGraphic rtColor

Caption CaptionColor Font FontSize getFirstElement (rtCollection) getFirstElement (rtContainer) getNextElement (rtCollection) getNextElement (rtContainer) getRichTextItem Image ResourceName setRGB Style Typeface

Code fragment from sample "Replace attachment icon"; see full running samples in downloadable help.
Dim coll as rtCollection, att as rtAttachment, img as rtGraphic, cnt as Integer

call
ctxDump.getRichTextItem(doc, "Body")

Set att = ctxDump.getFirstElement (RT_OBJ_ATTACHMENT)
Do While Not att is Nothing
set img = att.Image
cnt = cnt + 1
if Not img is Nothing then
img.ResourceName = "de.gif"
eval = Evaluate(|@subset(@subset(@AttachmentNames;| &cnt &|);-1)|,doc)
attName = eval(0)
img.caption=attName
Set img.Style = New rtStyle(0)
With img.Style
Set .Font = New rtFontStyle(0)
.Font.TypeFace = "BrushScript"
.Font.FontSize = 24
End With
Set img.CaptionColor= New rtColor(0)
img.CaptionColor.setRGB 54,106,182
End If
Set att = ctxDump.getNextElement (RT_OBJ_ATTACHMENT, Nothing)
Loop