多个Notes文档中附件批量汇总到一个文档中
来源:互联网 发布:it狂人第三季 编辑:程序博客网 时间:2024/05/18 11:06
Sub Initialize()
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
Dim doc2 As NotesDocument
Dim NotesRichTextItem As NotesRichTextItem
Dim NotesItem As NotesItem
Dim workspace As New NotesUIWorkspace
Dim result As Variant
result = workspace.Prompt( 13, "Choose database to save the attachments", "")
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
If result(0) = "" & result(1) = db.Filename Then
Set doc2 = db.Createdocument()
Else
Dim db2 As NotesDatabase
Set db2 = session.GetDatabase( result(0), result(1), False )
Set doc2 = db2.Createdocument()
End If
// 此处假定新建文档基于表单“Main Topic”,并将附件汇总到 Body 富文本域中
doc2.Form = "Main Topic"
doc2.Subject = "New Attachment"
Set NotesRichTextItem = New NotesRichTextItem( doc2, "Body" )
While Not(doc Is Nothing)
// 此处假定附件是嵌入在 Body 域当中,当然也可以循环文档所有的域,然后对于富文本域进行处理,提取附件
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:\temp\" & o.Name )
Call notesRichTextItem.EmbedObject( EMBED_ATTACHMENT ,"", "c:\temp\" & o.Name)
Kill "c:\temp\" & o.Name
End If
End ForAll
End If
Set doc = collection.GetNextDocument(doc)
Wend
Call doc2.Save(False, True )
End Sub
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim rtitem As Variant
Dim doc2 As NotesDocument
Dim NotesRichTextItem As NotesRichTextItem
Dim NotesItem As NotesItem
Dim workspace As New NotesUIWorkspace
Dim result As Variant
result = workspace.Prompt( 13, "Choose database to save the attachments", "")
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()
If result(0) = "" & result(1) = db.Filename Then
Set doc2 = db.Createdocument()
Else
Dim db2 As NotesDatabase
Set db2 = session.GetDatabase( result(0), result(1), False )
Set doc2 = db2.Createdocument()
End If
// 此处假定新建文档基于表单“Main Topic”,并将附件汇总到 Body 富文本域中
doc2.Form = "Main Topic"
doc2.Subject = "New Attachment"
Set NotesRichTextItem = New NotesRichTextItem( doc2, "Body" )
While Not(doc Is Nothing)
// 此处假定附件是嵌入在 Body 域当中,当然也可以循环文档所有的域,然后对于富文本域进行处理,提取附件
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:\temp\" & o.Name )
Call notesRichTextItem.EmbedObject( EMBED_ATTACHMENT ,"", "c:\temp\" & o.Name)
Kill "c:\temp\" & o.Name
End If
End ForAll
End If
Set doc = collection.GetNextDocument(doc)
Wend
Call doc2.Save(False, True )
End Sub
0 0
- 多个Notes文档中附件批量汇总到一个文档中
- Notes文档中附件批量导出到本地系统
- 把domino中文档中的附件拷贝考另外的一个文档中
- c#如何合并多个word文档中的内容到一个word中
- 一个word文档中,多个表格的批量调整(根据窗口调整表格和添加表格水平线)
- Lotus Notes 数据库中附件的批量导出
- 多个excel文档合并到一个excel文档里
- AngularJS中一个HTML文档启动多个应用
- 如何在word文档中添加附件
- 如何把服务器上的多个Word文档合并到一个Word文档中并且动态填充指定的内容
- 用VBA批量替换多个Word文档中同一内容
- 从文档中分离excel附件到磁盘,再打开该xls文件
- MFC 多文档中同时打开多个文档
- MFC 多文档中同时打开多个文档
- 使用java将多种类型的文件如Word、PDF、JPG汇总到一个文档中(Word或者PDF)
- Word2013中合并多个文档
- 用delphi吧一个word文档追加到另外一个word文档中
- 怎样把一个控件添加到文档视图中
- 初学pyse
- 使用mm命令遇到的问题
- Hive自定义函数(UDF、UDAF)
- 自定义View简单折线图
- mq浅析
- 多个Notes文档中附件批量汇总到一个文档中
- 理解页面重构和回流
- IText实现对PDF文档属性的基本设置
- Android中常用方法的归纳集合总结(二)
- php适配器模式
- xx.net飞墙
- 深度学习笔记(0)——机器学习基本概念
- 静态语言与动态语言
- Swagger UI & Swashbuckle