用于下载附件的Outlook脚本停止工作 [英] Outlook script used to download attachments stopped working

查看:133
本文介绍了用于下载附件的Outlook脚本停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面有一个小脚本,该脚本用于从包含主题中特定单词的电子邮件中下载附件.

I have a small script located below that I use to download attachments from emails that contain specific words in the subject.

它工作了一段时间,但是最近我遇到了间歇性的问题,因为它没有下载附件.

It worked good for a while but recently I have been experiencing intermittent issues with it not downloading the attachments.

我开始认为规则是问题所在,而不是脚本.

I'm starting to think the rule is the issue and not the script.

Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "path where to save file"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\inventory.csv"
Set objAtt = Nothing
Next
End Sub

这是规则:

Apply this rule after the message arrives
with CPN in the subject
  and on this computer only
run Project1.saveAtachtoDisk

你们是我的最后希望,因为没人能帮助我.

You guys are my last hope as nobody else can help me.

推荐答案

尝试将任何日志记录语句添加到VBA宏子程序中,以确保在Outlook中触发了该规则.例如,您可以创建一个文本文件并在其中添加日志条目.

Try to add any logging statements to the VBA macro sub to make sure that the rule is triggered in Outlook. For example, you can create a text file and add log entries there.

saveFolder =保存文件的路径"

saveFolder = "path where to save file"

代码中到底指定了什么文件夹路径?

What exactly folder path is specified in the code?

For Each objAtt In itm.Attachments
  objAtt.SaveAsFile saveFolder & "\inventory.csv"

您似乎用相同的名称保存了附件.在这种情况下,多个附件将被覆盖-磁盘上仅保存一个文件.是这样吗?

It looks like you save attachments with the same name. In that case multiple attachments will be overwritten - only one file will be saved on the disk. Is that the case?

这篇关于用于下载附件的Outlook脚本停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆