上面有点复杂,不需要指定富文本域。
Dim session As New NotesSession
Dim doc As NotesDocument
....
Dim AttachmentNames As Variant
AttachmentNames =Evaluate({@AttachmentNames},doc)
Forall AttachmentName in AttachmentNames
If AttachmentName<>\"\" Then
Dim object As NotesEmbeddedObject
Set object=doc.GetAttachment(AttachmentName)
If Not object Is Nothing Then
Call object.ExtractFile(解压文件路径,如果考虑不同文档存在同名文件,需要考虑规则)
End If
End If
End Forall
收起多看看帮助, 帮助上写的例子是这样的, 参考一下。
Dim doc As NotesDocument
Dim rtitem As Variant
\'...set value of doc...
Set rtitem = doc.GetFirstItem( \"Body\" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
Call o.ExtractFile( \"c:\samples\\" & o.Source )
Call o.Remove Call doc.Save( False, True )
End If
End
Forall
End If
收起