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
|