同時打開許多電子郵件可能會使Outlook超載,從而導致Outlook崩潰。 因此,建議限制同時打開的電子郵件數量。 這個post 將教您如何使用Outlook VBA實現它。
過載時(例如同時打開太多電子郵件),Outlook容易崩潰。 因此,您最好一次只打開有限的電子郵件。 儘管Outlook本身不支持此功能,但是您可以通過以下方式輕鬆實現。

限制同時打開的電子郵件數量
- 從一開始tar您的Outlook程序。
- 然後,您需要訪問VBA編輯器。 您可以轉到“開發人員”選項卡,然後單擊“ Visual Basic”按鈕。 或者只需在主屏幕中按“ Alt + F11”鍵。
- 在隨後的“ Microsoft Visual Basic for Applications”窗口中,您可以找到並打開“ ThisOutlookSession”項目。
- 接下來,您應該將下面的VBA代碼複製並粘貼到該VBA項目中。
Public WithEvents objInspectors As Outlook.Inspectors
Private Sub Application_Startup()
Set objInspectors = Outlook.Application.Inspectors
End Sub
Private Sub objInspectors_NewInspector(ByVal objNewInspector As Inspector)
Dim objInspector As Outlook.Inspector
Dim i As Long
Dim strMsg As String
Dim nPrompt As Integer
i = 0
If objNewInspector.CurrentItem.Class = olMail Then
If objInspectors.count > 5 Then
For Each objInspector In objInspectors
If objInspector.CurrentItem.Class = olMail Then
i = i + 1
End If
Next
If i > 5 Then
strMsg = "You're allowed to open 5 emails at the same time. The previous email is closed!"
MsgBox strMsg, vbExclamation + vbOKOnly
ActiveInspector.CurrentItem.Close olSave
End If
End If
End If
End Sub
- 之後,您應該簽署此宏。
- 點擊工具欄中的“工具”按鈕。
- 接下來,從下拉列表中選擇“數字簽名”選項。
- 在彈出對話框中,按照屏幕上的說明完成操作。
- 以後,您可以更改宏設置以允許進行數字簽名的宏。
- 最終,您可以tar您的Outlook應用程序可激活該宏。
- 從現在開始,每次您打算打開第六封電子郵件時,您都會收到一條消息,如屏幕截圖所示:
- 另外,先前的電子郵件將自動關閉。
檢索有價值的Outlook數據
無可否認,Outlook具有許多非凡的功能。 但是,這並不意味著它是完美的。 它仍然無法擺脫損害。 各種因素都可能導致Outlook損壞。 因此,以 恢復Outlook 為了簡化數據,您應該定期備份PST文件。 此外,優質的維修工具也是必要的,例如 DataNumen Outlook Repair.
作者簡介:
Shirley Zhang是的數據恢復專家 DataNumen,Inc.是數據恢復技術的全球領導者,包括 修復mdf 和Outlook修復軟件產品。 欲了解更多信息,請訪問 萬維網。datanumen.COM

