2017-03-24 10 views
0

私のプロジェクトでは、生成ボタンをクリックするたびにLotusScriptエージェントを実行して、「添付ファイル」リッチテキストフィールド内に「.pdf」ファイルを作成します。ここでリッチテキストフィールドで複数のドキュメントを添付する

ある一つの文書に挿入するための私のスクリプト:

' ... 

Dim oitem As NotesRichTextItem, eo As NotesEmbeddedObject, path$, template 
path = Environ$("TEMP") + "\" 
template = "" 
Set oitem = setdoc.Getfirstitem("AttachmentCert") 
If oitem.Type = RICHTEXT Then 
    ForAll o In oitem.Embeddedobjects 
     Set eo = o 
     If eo.Type = EMBED_ATTACHMENT Then 
      template = path + eo.Source 
      If Dir$(template, 0) <> "" Then Kill template 
      Call eo.Extractfile(template) 
      Exit ForAll 
     End If 
    End ForAll 
End If 

' ... 

result = path + "Certificate of Compentency for " + names + ".pdf" 
Set rtitem = New NotesRichTextItem(doc, "License_Cert") 
Call rtitem.Embedobject(EMBED_ATTACHMENT, "", result) 

問題面する:私はそれを行うことができますどのようにリッチテキストフィールドに複数の文書を添付したい場合は?

私はこのコードを試してみたが、それは働いていない:

If doc.hasItem("License_Cert") Then 
    Set rtItem = doc.getFirstItem("License_Cert") 
    ' Add a couple of lines to the rich text field before re-attaching the file 
    Call rtItem.addNewLine(2) 
Else 
    Set rtItem = New notesRichTextItem(doc, "License_Cert") 
End If 

今では、同じ名前のフィールドを複製し、それは大丈夫でしょうか?

screenshot

+0

関連する行は 'Call rtitem.Embedobject(EMBED_ATTACHMENT、"、result) 'であり、" result "(添付するファイルへのパス)の値が異なるものを繰り返す必要があります。 .. –

+0

これを使用してイメージをアップロードするだけです:add newline –

答えて

2

あなたは、単にそれを行うrichtext-項目に複数の添付ファイルを追加します。あなたのコードは、コンテンツのサイズが特定の値よりも大きい場合の注意事項はただの中で、「ボディ」の項目をチェックし、同じ名前で複数のアイテムを作成することは完全に正常であり、この

If doc.hasItem("License_Cert") Then 
    Set rtItem = doc.getFirstItem("License_Cert") 
    ' Add a couple of lines to the rich text field before re-attaching the file 
    Call rtItem.addNewLine(2) 
Else 
    Set rtItem = New notesRichTextItem(doc, "License_Cert") 
End If 

result = path + "Certificate of Compentency for " + names + ".pdf" 
Call rtitem.Embedobject(EMBED_ATTACHMENT, "", result) 
result = path + "Some other pdf.pdf" 
Call rtitem.Embedobject(EMBED_ATTACHMENT, "", result) 

ようになります。大きいメール...

関連する問題