아마 뭔가 :
Public WithEvents myOlInspectors As Outlook.Inspectors
Public myInspectorsCollection As New Collection
Private Sub Application_Startup()
Initialize_handler
End Sub
Public Sub Initialize_handler()
Set myOlInspectors = Application.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector)
If (Inspector.CurrentItem.Class = olMail) Then
If Inspector.CurrentItem.Parent = "Inbox" Then
strCats = Inspector.CurrentItem.Categories
If InStr(strCats, "Read") = 0 Then
If Not strCats = vbNullString Then
strCats = strCats & ","
End If
strCats = strCats & "Read"
Inspector.CurrentItem.Categories = strCats
Inspector.CurrentItem.Save
End If
End If
End If
End Sub
위 ThisOutlookSession에 가야한다. 보안 레벨이 매크로를 허용하는지 확인해야합니다.
감사합니다. ItemChange 이벤트를 잡으려고했는데 NewInspector 이벤트에 대해 알지 못했습니다. 그것은 더 잘 어울립니다. Insightor.CurrentItem.Parent.FolderPath = "\\ Mailbox - support \ Inbox"인 경우 을 추가 한 다음 을 열어 두 번째 사서함으로 제한합니다. –