我是否知道应该在宏中添加哪些代码才能在我看到它进入收件箱后立即将文件从收件箱传输到另一个特定文件夹?我不希望自动将它转发到另一个文件夹,我希望一旦我按下特定的键组合就会发生这种情况。请帮忙?我不熟悉Visual Basic吗?
答案 0 :(得分:0)
您不需要宏来执行此操作,可以使用规则来完成。
我假设Outlook 2013,但这基本上适用于大多数版本:
答案 1 :(得分:0)
'http://msdn.microsoft.com/en-us/library/office/ff860683(v=office.15).aspx
Sub MoveMessageToTestFolder()
' Works on one selected item
Dim myNameSpace As Outlook.Namespace
Dim myInbox As Outlook.Folder
Dim myDestFolder As Outlook.Folder
Dim myItem As Object
Set myNameSpace = Application.GetNamespace("MAPI")
Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
' Add As many .Folders("SubfolderName") as needed
Set myDestFolder = myInbox.Folders("Test")
Set myItem = Application.ActiveExplorer.Selection.Item(1)
If TypeOf myItem Is mailitem Then
myItem.Move myDestFolder
End If
Set myNameSpace = Nothing
Set myInbox = Nothing
Set myDestFolder = Nothing
Set myItem = Nothing
End Sub
http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/