【问题标题】:Is it possible to extract an attachment in a document in IBM Domino Notes是否可以在 IBM Domino Notes 的文档中提取附件
【发布时间】:2018-07-14 09:40:21
【问题描述】:

是否可以在 IBM Domino Notes 的文档中提取附件。我想有效地运行一个脚本,该脚本将在某些文档中提取某些附件。我真的不知道从哪里开始:'(

【问题讨论】:

    标签: lotus-notes lotus-domino lotusscript domino-designer-eclipse


    【解决方案1】:

    如果您真的不知道从哪里开始,这里有一条经验法则:从 Google 开始,而不是 StackOverflow。

    搜索字符串:莲花笔记附件示例脚本

    命中 #1 指的是 LCLSX。

    忽略。

    Hit #2 是 IBM 帮助页面 Working with attachments and embedded objects in LotusScript® classes

    好的,这看起来很有希望。它带来了很多信息,但它是孤立的参考信息,而不是教程。但看!在页面底部!有一个标记为Examples: Working with attachments and embedded objects in LotusScript® classes 的链接。

    这正是您所需要的。这就是真正的开始。

    【讨论】:

      【解决方案2】:

      我的一般建议:
      打开IBM Domino Designer Documentation 并搜索您感兴趣的主题。

      在这种情况下,在搜索字段中输入“附件”,您将获得一个匹配列表。
      七的条目显示“ExtractFile (NotesEmbeddedObject - LotusScript)”。
      您将在本文档中找到如何提取附件的说明,包括示例。

      这是 StackOverflow 上的 example

      【讨论】:

        【解决方案3】:

        有几种方法可以做到这一点。我将描述一个简单的。

        假设currentDoc 是当前文档(NotesDocument 实例)。并假设此文档只有一个附件。

        Dim commandResult As Variant
        Dim attachedFileName As String
        
        commandResult = Evaluate({@AttachmentNames}, currentDoc) 'getting attachment names
        attachedFileName = commandResult(0) 'getting the first value from the list of attached names
        
        if attachedFileName = "" then
           MsgBox "There's no attached file in this document", 64, "Note"
           Exit Sub
        End If
        
        Set attachedFileObject = currentDoc.Getattachment(attachedFileName) 'getting object with attached file
        Call attachedFileObject.ExtractFile( {C:\Temp\} + attachedFileName) 'extracting file to the C:\Temp folder
        

        如果您想分离所有文件,请遍历 commandResult,其中将包含所有附加文件的名称。

        【讨论】:

          猜你喜欢
          • 2014-08-20
          • 1970-01-01
          • 2021-12-16
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-10-31
          • 2014-08-02
          • 1970-01-01
          相关资源
          最近更新 更多