有没有办法将 outlook 中通过电子邮件收到的 excel 报告自动发送到文件夹?
Is there a way to send excel report receives by email in outlook to a folder automatically?
我每天通过 outlook 收到 excel 报告。有没有办法让报告每天或在我收到电子邮件时自动拖到文件夹中?
示例 - 缺货报告每天都会发送给我们,我希望 excel 每次都自动转到特定文件夹。
谢谢,
你可以抛出 VBA 宏。
Outlook - File - Options - Customize Ribbon
标记“开发者”。在主菜单中可以看到“Developer”。
在子菜单中查找 - Visual Basic
在新项目 1 中单击鼠标右键并点击插入 - 模块。
打开 window 宏并在下面注释:
Public Sub saveAtt (itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment 'var for work with attachments
Dim saveFolder As String 'var for dest folder
Dim sDateMail as string 'var for email date
'save in right format email time
sDateMail = Format(itm.CreationTime, "hh-mm-ss_dd.mm.yyyy")
'set dest folder
saveFolder = "C:\Users\John Doe\Desktop\"
'sort all attachments in memail
For each objAtt in itm.Attachments
'save attachment in folder with name: email_date + attachment_filename
objAtt.SaveAsFile saveFolder & "\" & sDateMail & "_" & objAtt.FileName
'clear var for work with attachments
Set objAtt = Nothing
Next objAtt
End Sub
按 Ctrl + S 保存。
之后您需要为目标电子邮件创建规则。
我每天通过 outlook 收到 excel 报告。有没有办法让报告每天或在我收到电子邮件时自动拖到文件夹中? 示例 - 缺货报告每天都会发送给我们,我希望 excel 每次都自动转到特定文件夹。
谢谢,
你可以抛出 VBA 宏。
Outlook - File - Options - Customize Ribbon
标记“开发者”。在主菜单中可以看到“Developer”。
在子菜单中查找 - Visual Basic
在新项目 1 中单击鼠标右键并点击插入 - 模块。
打开 window 宏并在下面注释:
Public Sub saveAtt (itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment 'var for work with attachments
Dim saveFolder As String 'var for dest folder
Dim sDateMail as string 'var for email date
'save in right format email time
sDateMail = Format(itm.CreationTime, "hh-mm-ss_dd.mm.yyyy")
'set dest folder
saveFolder = "C:\Users\John Doe\Desktop\"
'sort all attachments in memail
For each objAtt in itm.Attachments
'save attachment in folder with name: email_date + attachment_filename
objAtt.SaveAsFile saveFolder & "\" & sDateMail & "_" & objAtt.FileName
'clear var for work with attachments
Set objAtt = Nothing
Next objAtt
End Sub
按 Ctrl + S 保存。
之后您需要为目标电子邮件创建规则。