1

一部の RichText フィールドにテキストとインライン画像の両方が含まれる NotesDocument があります。そのアイテムのテキスト部分を取得できますが、lotusscript を使用してインライン画像を取得できません。そのドキュメントからインライン画像を取得する方法を教えてください。LotusScript コード:

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

ありがとう。

4

4 に答える 4

3

Midas は最も簡単な方法ですが、無料ではありません。(全体の時間の節約という点ではお金以上の価値がありますが、あなたの組織が私が働いていたようなものである場合、ツールの全費用は現在のプロジェクトを所有する請求単位に押し付けられます。組織全体で償却するのではなく、コストに同意する前に要件を変更する可能性があります。) 別の方法として、エクスポート オプション ConvertNotesBitmapToGIF を使用してデータベースを DXL (Domino XML) にエクスポートする方法があります。画像は XML で次のように表示されます。<picture>Base64 でエンコードされたデータを持つ要素。完全に Notes 環境内で操作している場合は、(NotesStream を使用して) ファイルにストリーミングする前に、エンコードされた画像をバイナリに変換するために、NotesMIMEEntity として使用されるリッチ テキスト フィールドを含む一時ドキュメントを作成する必要があります。これはすべて、バージョン 6 以降で作業していることを前提としています。R5 以前を使用している場合、Midas を使用するか、C API を使用して CD レコードに直接アクセスすることが唯一の飛行方法です。

于 2010-11-08T07:11:48.357 に答える
0

Genii Software MidasLSX 製品をご覧になることをお勧めします。これらは、複雑な Lotus Notes リッチ テキスト アイテムの処理を容易にする LotusScript 拡張機能のパッケージを提供します。

http://www.geniisoft.com/showcase.nsf/MidasHelp

それ以外の場合は、NotesRichTextNavigator クラスを試して、(理論上は) リッチ テキスト アイテム内の画像にアクセスできます。この種のことに関するドキュメントはほとんどありません。そのクラスを使用すると画像がどのように表示されるかはよくわかりませんが、リッチ テキスト項目をナビゲートし、画像を NotesEmbeddedObject として処理できると仮定すると、オブジェクトをディスクに保存する方法があることがわかります。そのクラス。

別の (クレイジーな) 考えは、ドキュメントを電子メールで送信し、電子メールの本文をより簡単に処理できる別のプログラムで受信することです。Notes は、独自のリッチ テキスト フィールドを処理するのにあまり役に立ちません。

于 2010-10-25T15:23:50.170 に答える
-1

これは、ドキュメントのリッチテキスト フィールドからファイルを切り離すために使用するエージェントです。

Option Public
Dim uidoc As notesuidocument
Dim doc As NotesDocument
Dim db As NotesDatabase
Dim obj As NotesEmbeddedObject
Dim collection As NotesDocumentCollection
Dim rt As Variant
Dim attachNames As Variant
Dim i As Integer, x As Integer
Dim j As Integer
' Agent  - Detach Attachments to C drive for later reattachment
' Copies all attachment in richtext field to personal directory.

Sub Initialize
    Dim ws As New notesuiworkspace
    Dim ses As New NotesSession
    Set db = ses.CurrentDatabase
    Set collection = db.UnprocessedDocuments
    '  get first doc in collection
    For j = 1 To collection.Count
        Set doc = collection.GetNthDocument( j )    
' ---  create array of filenames of all the attachments in the document
        i = 0
        Redim attachNames(i)
        Forall x In doc.items
            If x.name = "$FILE" Then
                attachNames(i) = x.values(0)
                i = i + 1
                Redim Preserve attachNames(i)
            End If
        End Forall

        If i > 0 Then
            Redim Preserve attachNames(i-1)
        End If

' ---  for all of the filenames in attachNames, if it exists in the rich text field, detatch them
        If doc.hasItem("richtextfieldname") Then
            Set rt = doc.GetFirstItem("richtextfieldname")
        End If
        If attachNames(0) <> "" Then
            Forall x In attachNames 
                Set obj = rt.GetEmbeddedObject( x )
                If Not( obj Is Nothing ) Then
                    Call obj.ExtractFile( "C:\path\" & Cstr(x) )
                End If
            End Forall
        End If
        Call doc.save(True, False)
    Next
End Sub
于 2012-12-05T22:39:52.753 に答える