我们的团队有一个共享邮箱,我们每天在其中收到数百封邮件,我们必须手动将它们从收件箱拖到单独的子收件箱中。那么是否有任何规则或宏可以自动拖动它们。
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
当然,您必须在此代码中添加对象验证。
您还可以查看 VBA(不是您正在使用的 VBS)示例 http://msdn.microsoft.com/en-us/library/office/ff860683.aspx