作成者カテゴリ返答の対象
公開
ナカダ
12/08/1998 06:37 PM
文書リンクアイコン 添付ファイルを自動保存できますか?
添付ファイルの保存

下の式で、添付ファイルを保存することができると思います。

Dim s As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
Dim fileCount As Integer
fileCount = 0

Set db = s.CurrentDatabase
Set collection = db.AllDocuments
Set doc = collection.GetFirstDocument
Do Until doc Is Nothing
Set rtitem = doc.GetFirstItem( "RichText" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
fileCount = fileCount + 1
Call o.ExtractFile _
保存する場所の指定です。→ ("C:\ノーツワーク\RichTextFile" )

RichTextFiel は、保存時のファイルの名前です
GetAttachment などを使って Item の名前を取るなどの
工夫が必要になるかと思います。

End If
End Forall
End If
Set doc = collection.GetNextDocument(doc)
Loop

この式は、全てのドキュメントを取り、そのコレクションから
添付ファイルを検索し、保存させるスクリプトです。
問題は、添付ファイル以外のオブジェクトがフィールドに
入っているとエラーになります。


[Previous Main Document]
添付ファイルを自動保存できますか? (Munechika)
. . 添付ファイルの保存 (ナカダ) * 現在地 *
. . . . ありがとうございます。 (Munechika)
. . . . 添付ファイル保存エラーの対処法は? (EM)
. . . . オブジェクト変数エラーがでてしまう (ヨッシー)
[Next Main Document]