我寫了一個宏,它循環遍歷用戶日曆,並對修改某個特定標識符的條目進行修改。通過Outlook約會項目快速迭代
問題是,當日歷非常大時,這需要很長時間才能完成。我似乎無法篩選約會,因爲oAppointmentItems
似乎是在創建時存儲條目的 - 這不一定與它們啓動時的順序相同。
我正在使用的代碼是這樣的:
Dim oOL As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oAppointments As Object
Dim oAppointmentItem As Outlook.AppointmentItem
Set oNS = oOL.GetNamespace("MAPI")
Set oAppointments = oNS.GetDefaultFolder(olFolderCalendar)
For Each oAppointmentItem In oAppointments.Items
DoEvents
' Something here
Next
Set oAppointmentItem = Nothing
Set oAppointments = Nothing
Set oNS = Nothing
Set oOL = Nothing
短除去DoEvents
(這僅意味着在Outlook似乎鎖定到用戶)的是沒有什麼辦法可通過施加加快這某種過濾器?例如,約會在未來開始。
這正是我一直在尋找今天的工作!這爲我節省了很多麻煩。但我注意到的一件事是,我無法使用=來使用日期過濾器,並且很難獲得確切的日期(似乎取決於它們是在Outlook中是日期還是日期/時間)。 Like> Date - 1天和 Date和Date
Jeff
2010-07-27 16:53:34
在VBA中使用早期綁定,olRecItems應如何DIM'd? (外表。???)。謝謝.. – 2012-05-22 13:41:47
@iDevlop as Outlook.MAPIFolder AFAIK。 – Fionnuala 2012-05-22 13:48:53