我需要在Outlook中以升序模式循環使用vba腳本。循環和整理電子郵件項目
我嘗試了幾種方法,但似乎它總是以降模式循環。
有更快的方式來循環瀏覽電子郵件項目嗎?
謝謝。 的代碼是一樣的東西:
Public Sub CheckClient()
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim items As Outlook.items
Dim strFind As String
Dim Item
Set objNS = GetNamespace("MAPI")
Set objFolder = objNS.PickFolder()
strFind = "[ReceivedTime] >= '05/15/2017' AND [ReceivedTime] < '05/16/2017'"
Set items = objFolder.items
items.Sort "[ReceivedTime]", True
Set items = objFolder.items.Restrict(strFind)
For Each Item In objFolder.items
If TypeName(Item) = "MailItem" Then
If Item.Sender = "Client1" Then
DBInsert (Item)
End if
Next
End Sub
此示例代碼不運行更新
%Client1%
。見[mcve]。 – niton