• 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:	emp" & "" & 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

  • 相关阅读:
    java.sql.SQLException: 不支持的字符集 (在类路径中添加 orai18n.jar): ZHS16GBK
    STS工具各版本下载网址
    SpringBoot访问不了JSP但却能进入后台
    springboot o.a.tomcat.util.scan.StandardJarScanner : Failed to scan [file:/D:/apache-maven-3.0.5[系统找不到指定路径]
    STS工具:mybayis连接oracle数据库
    springBoot怎样访问静态资源?+静态资源简介
    springboot注解
    8.12-14 df 、mkswap、swapon、swapoff、sync
    8.5-7 mkfs、dumpe2fs、resize2fs
    8.2-3 partprobe、tune2fs
  • 原文地址:https://www.cnblogs.com/renfeng/p/12609158.html
Copyright © 2020-2023  润新知