0
m.display
工作但m.move(A)
没有。VBA展望2010移动
该文件夹存在。
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim arr() As String
Dim myInbox As Outlook.Folder
Dim A As Outlook.Folder
Set myNameSpace = Application.GetNamespace("MAPI")
Set myInbox =
myNameSpace.GetDefaultFolder(olFolderInbox)
Set A = myInbox.Folders("A")
Dim i As Integer
Dim m As MailItem
On Error Resume Next
arr = Split(EntryIDCollection, ",")
For i = 0 To UBound(arr)
Set m = Application.Session.GetItemFromID(arr(i))
If m.SenderEmailAddress = "[email protected]" Then
'MsgBox (m.Body)
m.Display
m.Move (A)
End If
Next
End Sub
只是可能遇到的一个小错误。 'For i = 0 To UBound(arr)'应该是'For i = 0 To UBound(arr) - 1' – PatricK