0

我们的团队有一个共享邮箱,我们每天在其中收到数百封邮件,我们必须手动将它们从收件箱拖到其单独的子收件箱中。那么是否有任何规则或宏可以自动拖动它们。

4

1 回答 1

0

VBS 样本

Set objOutlook = GetObject (, "Outlook.Application")
Set objNamespace = objOutlook.GetNameSpace ("MAPI")

Set objFolderRoot = objNamespace.Folders ("Y2013")

Set objFolderSource = objFolderRoot.Folders ("Inbox")
Set objFolderDistance = objFolderRoot.Folders ("test")

MsgBox "Total emails is Inbox folder: " & objFolderSource.Items.Count

Set objEmail = objFolderSource.Items (1)

MsgBox "Subject of first email: " & objEmail.Subject

objEmail.Move objFolderDistance

Set objEmail = Nothing

Set objFolderDistance = Nothing
Set objFolderSource = Nothing

Set objFolderRoot = Nothing

Set objNamespace = Nothing
Set objOutlook = Nothing

当然,您必须在此代码中添加对象验证。

您还可以在http://msdn.microsoft.com/en-us/library/office/ff860683.aspx上查看 VBA(不是您正在使用的 VBS)示例

于 2014-01-10T11:10:41.603 回答