Domanda

ho scoperto gli eventi che il fuoco quando l'utente riceve un messaggio, o preme il pulsante di invio, ma niente che il fuoco quando l'utente crea un vuoto, nuova e-mail.

È stato utile?

Soluzione

Si dovrebbe essere in grado di utilizzare l'evento NewInspector. Esempio:

Public WithEvents myOlInspectors As Outlook.Inspectors

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)
    Dim msg As Outlook.MailItem
    If Inspector.CurrentItem.Class = olMail Then
        Set msg = Inspector.CurrentItem

        If msg.Size = 0 Then
            MsgBox "New message"
        End If
    End If
End Sub
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top