使用LotusScript从Lotus Notes检索嵌入式图像 [英] Retrieving inline images from Lotus notes using lotusscript

查看:96
本文介绍了使用LotusScript从Lotus Notes检索嵌入式图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些NotesDocument,其中一些RichText字段同时具有文本和嵌入式图像.我可以获取这些项目的文本内容,但无法使用Lotusscript检索嵌入式图像.任何人都可以建议我一种从该文档中检索嵌入式图像的方法. LotusScript代码:

I have some NotesDocument where some RichText fields have both text and inline images. I can get text part of that items but can't retrieve inline images using lotusscript. Could any one please suggest me a way to retrieve inline images from that documents. LotusScript code:

Sub Click(Source As Button)
    Dim session As New NotesSession   
    Dim db As NotesDatabase   
    Dim mainDoc As NotesDocument
    Dim v As NotesView   
    Set db = session.CurrentDatabase   

    Dim fileName As String
    Dim fileNum As Integer
    fileNum% = Freefile()
    fileName$ = "D:\data.txt"
    Open FileName$ For Append As fileNum%

    Set v = db.GetView("MyView")
    Set mainDoc = v.GetFirstDocument       

    While Not ( mainDoc Is Nothing )              
        Forall i In mainDoc.Items
            If i.Type = RICHTEXT Then
                 Write #fileNum% ,    i.Name & ":" & i.text  'how the images??
            End If
        End Forall              
        Set mainDoc = v.GetNextDocument( mainDoc )  
    Wend
End Sub

谢谢.

推荐答案

Midas是最简单的方法,但它不是免费的. (节省总时间成本是值得的,但是,如果您的组织像我工作过的组织那样,则该工具的全部成本将全部归于拥有当前项目的帐单部门,而不是而不是将其摊销到整个组织中,并且他们很可能会在同意成本之前更改要求.)还有另一种方法,那就是使用导出选项ConvertNotesBitmapToGIF将数据库导出到DXL(Domino XML).图像将以XML的形式显示为<picture>元素,并带有Base64编码的数据.如果您完全在Notes环境中操作,则需要创建一个带有RTF字段的临时文档,该字段用作NotesMIMEEntity,以便在将编码后的图片流式传输到文件之前(使用NotesStream)将其转换为二进制图片.所有这些都假定您使用的是版本6或更高版本.如果您使用的是R5或更早版本,Midas或使用C API直接访问CD记录都是唯一的飞行方式.

Midas is the easiest way to do it, but it isn't free. (It's more than worth the money in overall time saved, but if your organisation is anything like the ones I've worked for, the entire cost of the tool is going to be foisted off on the billing unit that owns the current project, rather than have it amortized over the entire org, and they're likely to change their requirements before agreeing to the cost.) There is another approach, and that's to export the database to DXL (Domino XML) using the export option ConvertNotesBitmapToGIF. The images will turn up in the XML as <picture> elements with the data Base64-encoded. If you're operating entirely within the Notes environment, you'll need to create a temporary document with a rich text field used as a NotesMIMEEntity to transform the encoded picture to binary before streaming it to a file (using NotesStream). All of this assumes that you are working with version 6 or higher; if you are on R5 or earlier, Midas or directly accessing the CD records using the C API are the only way to fly.

这篇关于使用LotusScript从Lotus Notes检索嵌入式图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆