0
Je voudrais trouver une chaîne dans un e-mail et supprimer tout le texte avant. Il est bien le contraire de ceci:Rechercher du texte dans un e-mail et supprimer tout le texte avant cela dans Outlook 2013
Option Explicit
Sub DeleteAfterText()
' Deletes all text after endStr.
Dim currMail As mailitem
Dim msgStr As String
Dim endStr As String
Dim endStrStart As Long
Dim endStrLen As Long
Set currMail = ActiveInspector.CurrentItem
endStr = "Text"
endStrLen = Len(endStr)
msgStr = currMail.HTMLBody
endStrStart = InStr(msgStr, endStr)
If endStrStart > 0 Then
currMail.HTMLBody = Left(msgStr, endStrStart + endStrLen)
End If
End Sub
Exemple tiré de cette page de débordement de la pile: Find Text in an email and delete all text after this in Outlook 2010
Merci pour votre aide.