Lotus Notes Lotus Script
Sub OutPutLink
Dim rtf As NotesRichTextItem
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doccol=db.AllDocuments '此方法仅能用于代理方能正常运行。
Set doc = doccol.GetFirstDocument()
flg=False
If doccol.count>0 Then
Set doc=doccol.Getfirstdocument()
For i=1 To doccol.count
On Error Resume Next
Set rti=doc.GetFirstItem("Body")
Set rtf=doc.GetFirstItem("Body")
Set rtnav=rti.CreateNavigator
Set rtlink = rtnav.getfirstelement(RTELEM_TYPE_DOCLINK)
flg=True
While (flg)
If Not rtlink Is Nothing Then
Call rtf.BeginInsert(rtnav)
Call rtf.AppendText(rtlink.Docunid)
Call rtf.EndInsert
Set rtlink = rtnav.getnextelement
Else
flg=False
End If
Wend
Call doc.Save(True,True)
Set doc=doccol.getnextdocument(doc)
Next
End If
Print "提取完毕!"
End Sub
Sub OutPutFile
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem As Variant
Dim NotesItem As NotesItem
Dim link As NotesRichTextDoclink
Dim flg As Boolean
Dim folderName As String
Dim id As String
Dim fileCount As Integer
fileCount=0
Dim subFolder As String
Set db = session.CurrentDatabase
Set doccol=db.AllDocuments '此方法仅能用于代理方能正常运行。
Set doc = doccol.GetFirstDocument()
flg=False
If doccol.count>0 Then
Set doc=doccol.Getfirstdocument()
For i=1 To doccol.count
Set rtitem = doc.GetFirstItem( "Body" )
Set rtf = doc.GetFirstItem( "Body" )
id=doc.UniversalID
folderName = "C:\temp" & "\" & id
On Error Resume Next
fileCount=0
If Dir$(folderName,16)="" Then
Mkdir folderName
End If
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
subFolder = folderName & "\" & fileCount
If Dir$(subFolder,16)="" Then
Mkdir subFolder
End If
Set obj=o
If Not obj Is Nothing Then
Call rtf.BeginInsert(obj)
Call rtf.AppendText("$$" & obj.Name & "$$")
Call rtf.EndInsert
End If
Call o.ExtractFile(subFolder & "\" & o.Name)
fileCount=fileCount+1
End If
End Forall
Dim attachName As Variant
Dim attachObj As NotesEmbeddedObject
attachName=Evaluate(|@AttachmentNames|,doc)
Forall item In attachName
Set attachObj= doc.GetAttachment(item)
If Not attachObj Is Nothing Then
subFolder = folderName & "\" & fileCount
If Dir$(subFolder,16)="" Then
Mkdir subFolder
End If
Call attachObj.ExtractFile(subFolder & "\" & item)
fileCount=fileCount+1
End If
End Forall
Set doc=doccol.getnextdocument(doc)
Next
End If
Print "提取完毕!"
End Sub
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
2014-03-31 C#打开关闭窗体事件顺序