Dim inputAttachment As NotesEmbeddedObject
Dim v_files As Variant
v_files = Evaluate(|@Trim(@Replace(@AttachmentNames;TANGER_OCX_filename;""))|,doc)
For i = 0 To Ubound(v_files)
Set inputAttachment = doc.GetAttachment(v_files(i)) '获取文件
If Not inputAttachment Is Nothing Then
Dim url As String
url = session.GetEnvironmentString("Directory",True) '路径为\domino\data目录
If Dir$(url+"\AttachmentTemp",16) ="" Then '判断在url+"\AttachmentTemp"目录是否存在,不存在则值为空,存在则值为AttachmentTemp
Msgbox "不存在"
Mkdir url + "\AttachmentTemp" '在url下面创建一个名为AttachmentTemp的文件夹
url = url +"\AttachmentTemp"
Else
Msgbox "存在"
url = url +"\AttachmentTemp"
End If
Msgbox "文件存储位置:" + url
Msgbox "文件名:" + inputAttachment.Name
Call inputAttachment.ExtractFile(url+"\temp.xls") '将附件存放到指定路径目录下
Dim v_files As Variant
v_files = Evaluate(|@Trim(@Replace(@AttachmentNames;TANGER_OCX_filename;""))|,doc)
For i = 0 To Ubound(v_files)
Set inputAttachment = doc.GetAttachment(v_files(i)) '获取文件
If Not inputAttachment Is Nothing Then
Dim url As String
url = session.GetEnvironmentString("Directory",True) '路径为\domino\data目录
If Dir$(url+"\AttachmentTemp",16) ="" Then '判断在url+"\AttachmentTemp"目录是否存在,不存在则值为空,存在则值为AttachmentTemp
Msgbox "不存在"
Mkdir url + "\AttachmentTemp" '在url下面创建一个名为AttachmentTemp的文件夹
url = url +"\AttachmentTemp"
Else
Msgbox "存在"
url = url +"\AttachmentTemp"
End If
Msgbox "文件存储位置:" + url
Msgbox "文件名:" + inputAttachment.Name
Call inputAttachment.ExtractFile(url+"\temp.xls") '将附件存放到指定路径目录下