Dim path As String, o As rtGraphic
path = Environ("TEMP")
if path<>"" then path = path + "\" ' it's a W32 client
Set ctx =New rtContainer
Call ctx.getRichTextItem(doc,"Body")
Set hotcoll = ctx.Collection(PARSE_GROUP_GRAPHIC) ' get images - import/export supported at the moment only R5 style native JPEG/GIF
Set enum = New rtEnumeration(hotcoll)

Dim fname(2) As String, cnt As Integer
fname(0)="flagDE"
fname(1)="flagEN"
fname(2)="flagIT"

Do While enum.hasMoreElements
 Set o = enum.nextElement
 If o.ImageType =CDIMAGETYPE_JPEG Then
  Set rtp = New rTextParagraph("JPEG image exported to " &path &"flagDE.jpg")
  ctxDump.addnewline 1
  ctxDump.add rtp
  o.exportToFile path &"\" &"flagDE" ' only one jpeg - its German flag
 End If
 If o.ImageType =CDIMAGETYPE_GIF Then
  ctxDump.addnewline 1
  ctxDump.appendText ("GIF image exported to " &path &fname(cnt) &".gif")
  o.exportToFile path &"\" &fname(cnt)
  cnt = cnt + 1
 End If
Loop
|