Sub Initialize    
         On Error Goto MsgError
         Dim session As New NotesSession
       Dim doc As NotesDocument
          Dim FilePath As String
          Dim fileNames As Variant
         Dim objEmbed As NotesEmbeddedObject
          
        Set doc=session.DocumentContext
         fileNames=Evaluate("@AttachmentNames",doc)  '获取文档所有附件名称
         filePath=session.GetEnvironmentString("Directory")  '环境变量
         If(Isarray(fileNames)) Then
                 Forall fileName In fileNames
                       filePath=filePath+"\"+fileName
                         Set objEmbed=doc.GetAttachment(filename)
                       Call objEmbed.ExtractFile(filePath)'将文档中的附件导出
                   Call objEmbed.Remove() '删除文档中的附件
           End Forall
       End If
       Exit Sub

MsgError:
        Msgbox "Error:"+Error$+" onLine:"+Cstr(Erl)
End Sub

相关文章:

  • 2021-10-16
  • 2022-12-23
  • 2021-11-29
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
相关资源
相似解决方案