Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:添加附件异常

1楼
ljh29206 发表于:2024/9/26 16:07:00
            For q As Integer = 1 To latestMailItem.Attachments.Count
            Dim files As String
            Dim FileName As String
            FileName = latestMailItem.Attachments(q).FileName
            Dim fmat As String = Filename
            Dim pathfile As String
            pathfile =  ProjectPath & "Attachments\" & "files" & "\" &  fmat
            If FileSys.DirectoryExists(ProjectPath & "Attachments\" & "files") = False Then
                FileSys.CreateDirectory(ProjectPath & "Attachments\" & "files")
            End If
            lst.Add(pathfile)
            latestMailItem.Attachments(q).SaveAsFile(pathfile) 
        Next


图片点击可在新窗口打开查看此主题相关图片如下:屏幕截图 2024-09-26 160106.png
图片点击可在新窗口打开查看

点打开邮件 会弹出这个信息

附件列 添加异常 ,  写入绝对路径 ,  文件夹里面的问题 打不开 ,请教什么问题呢
[此贴子已经被作者于2024/9/26 16:07:53编辑过]
2楼
有点蓝 发表于:2024/9/26 16:09:00
很明显是把一个单元格的多个文件当做是一个文件来处理的,当然找不到文件。看看:http://www.foxtable.com/webhelp/topics/2717.htm
3楼
ljh29206 发表于:2024/10/17 10:21:00
 篮板请教下

        Dim lst As New List(of String)
        If latestMailItem.Attachments.Count > 0 Then
            For q As Integer = 1 To latestMailItem.Attachments.Count
                
                Dim files As String
                Dim FileName As String
                FileName = latestMailItem.Attachments(q).FileName
                Dim fmat As String = Filename
                Dim pathfile As String
                pathfile =  ProjectPath & "Attachments\" & "files" & "\" &  fmat
                If FileSys.DirectoryExists(ProjectPath & "Attachments\" & "files") = False Then
                    FileSys.CreateDirectory(ProjectPath & "Attachments\" & "files")
                End If
                lst.Add(pathfile)
                latestMailItem.Attachments(q).SaveAsFile(pathfile)  '复制到emailsend 文件夹里面
            Next
        End If
        
        dra.Lines("附件") = lst
        dra.save

我的代码如上  添付的时候 已经是按照集合的形式添付的 了 , 不知道错在哪里  求明指点
4楼
有点蓝 发表于:2024/10/17 12:18:00
提示什么错误?
共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02734 s, 2 queries.