vba 查看谁移动了电子邮件以及从哪个文件夹移动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18656446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
See who moved an email and from which folder
提问by Rob
Is it possible to see who moves an email from a folder to a shared folder?
是否可以查看谁将电子邮件从文件夹移动到共享文件夹?
We have a shared email folder named "Work". In this folder there are e-mail items who need to be processed within an amount of time.
我们有一个名为“工作”的共享电子邮件文件夹。在此文件夹中有需要在一定时间内处理的电子邮件项目。
Sometimes, someone moves e-mail items back into this Work folder. I would like to see who moved the mail item into the folder and/or where the item came from.
Maybe with somekind of notification: %Username% moved an email with subject %Subject% from %source_folder% to "Work".
有时,有人将电子邮件项目移回此工作文件夹。我想查看谁将邮件项目移动到文件夹中和/或项目来自何处。
也许有某种通知:%Username% 将主题为 %Subject% 的电子邮件从 %source_folder% 移动到“工作”。
I'll guess somekind of Event should check new mail in "Work" with a recieve date older than lets say 2 hour. And with the help of the internet i can make that. But i can't find how to extract the information "who moved it" en "From where".
我猜想某种事件应该检查“工作”中的新邮件,接收日期早于 2 小时。在互联网的帮助下,我可以做到。但我找不到如何提取“谁移动它”和“从哪里”中的信息。
Any help or push howto extract that specific information would be great.
任何帮助或推动如何提取特定信息都会很棒。
回答by Paul-Jan
Using the Stackoverflow link provided by Richard Morgan, running it on machines of all users, you'll get an event the exact moment the mail is moved. The user running it can be queried using NameSpace.CurrentUser. Putting these two together gives you the required information.
使用Richard Morgan 提供的Stackoverflow 链接,在所有用户的机器上运行它,您将在邮件移动的确切时刻收到一个事件。可以使用NameSpace.CurrentUser查询运行它的用户。将这两者放在一起可为您提供所需的信息。
You'll probably want to gather this information in a central location for monitoring. As a suggestion, you could use the Outlook Object Model to send yourself a mail with this information. Additionally you might want to display a message informing the user that they really shouldn't be moving work back into the work folder (and management has been informed about their action). Using appropriate (nice and friendly) wording of course.
您可能希望在中央位置收集此信息以进行监控。作为建议,您可以使用 Outlook 对象模型向自己发送包含此信息的邮件。此外,您可能希望显示一条消息,通知用户他们真的不应该将工作移回工作文件夹(并且管理层已获悉他们的操作)。当然,使用适当的(友好的)措辞。