Option Explicit Private WithEvents oExpl As Explorer Private WithEvents oItem As MailItem Private bDiscardEvents As Boolean Private olFormat As OlBodyFormat Private Sub Application_Startup() Set oExpl = Application.ActiveExplorer bDiscardEvents = False 'olFormat = olFormatPlain '(*1) - uz.ywaj zawsze formatu "zwyk?y tekst" olFormat = olFormatHTML '(*2) - uz.ywaj zawsze formatu HTML End Sub Private Sub oExpl_SelectionChange() On Error Resume Next Set oItem = oExpl.Selection.Item(1) End Sub ' (*3) Uz.ytkownik wybra? polecenie "Odpowiedz" Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean) If bDiscardEvents Or oItem.BodyFormat = olFormat Then Exit Sub End If '(*4) Anuluj domys'lna; akcje; Cancel = True bDiscardEvents = True ' (*5) Utwo'rz odpowiedz' na wiadomos'c' w formacie tekstowym Dim oResponse As MailItem Set oResponse = oItem.Reply oResponse.BodyFormat = olFormat oResponse.Display bDiscardEvents = False End Sub ' (*6) Uz.ytkownik wybra? polecenie "Odpowiedz wszystkim" Private Sub oItem_ReplyAll(ByVal Response As Object, Cancel As Boolean) If bDiscardEvents Or oItem.BodyFormat = olFormat Then Exit Sub End If Cancel = True bDiscardEvents = True Dim oResponse As MailItem Set oResponse = oItem.ReplyAll oResponse.BodyFormat = olFormat oResponse.Display bDiscardEvents = False End Sub ' (*7) Uz.ytkownik wybra? polecenie "Przes'lij dalej" Private Sub oItem_Forward(ByVal Forward As Object, Cancel As Boolean) If bDiscardEvents Or oItem.BodyFormat = olFormat Then Exit Sub End If Cancel = True bDiscardEvents = True Dim oResponse As MailItem Set oResponse = oItem.Forward oResponse.BodyFormat = olFormat oResponse.Display bDiscardEvents = False End Sub