Recent content by Dr. Bartolo

  1. D

    Delete selected text from incoming emails

    The something simple was to close and restart Outlook! Now it all seems to be working as it should. I shall keep an eye on it for the next few days to be sure.
  2. D

    Delete selected text from incoming emails

    I find it hard to work out quite what changes you are advising me to make, so here is the full amended code - which produces exactly the same result - nothing changes! If Item.BodyFormat = olFormatPlain Then b = Item.body OldText = "Text to remove." NewText = "" b = Replace(b, OldText...
  3. D

    Delete selected text from incoming emails

    I am not sure I understand that. If I write this: If Item.BodyFormat = olFormatPlain Then b = lcase(Item.Body) OldText = Replace(Item.body, "Text to Remove" & vbCrLf, "") NewText = "" Item.body = b End If which is the code currently not working as it should, where would I add b = Item.body?
  4. D

    Delete selected text from incoming emails

    What that does is to replace the old text with the same text all in lower case.
  5. D

    Delete selected text from incoming emails

    I cannot see anything unique at all. Having checked, the string I am looking for is not duplicated, although the first two words do form part of a different string. I would have thought that would not count. You are right, the second half of the macro is not working on plain text.
  6. D

    Delete selected text from incoming emails

    Much to my surprise I managed to get this to work - sort of. I added in declarations (is that the right name?): Dim b$ Dim OldText$ Dim NewText$ before the first line of code in your last message, without which the code was not working. Most incoming HTML e-mails now arrive with the text...
  7. D

    Delete selected text from incoming emails

    I tried forwarding an HTML email to myself with the code switched on and off and now that I look at it more closely you are absolutely right. All the HTML code is stripped out. So ideally what I would need would be code that tests to see if an incoming e-mail is HTML or not. If not, the...
  8. D

    Delete selected text from incoming emails

    I am getting there! That works, and it also works if I add in & vbcrlf. The trouble is that I now see that there are three carriage returns I would like to get rid of. In my naivety I tried adding in two more & vbcrlf and, as I half suspected, that did less than nothing at all - in fact the...
  9. D

    Delete selected text from incoming emails

    I should have said the syntax error is on the replaced line of code.
  10. D

    Delete selected text from incoming emails

    I have managed to get rid of the original error (I am not quite sure how), and the message box did appear as you said it would. When I replaced it, however, I got a syntax error. No doubt I read your instructions wrongly. What I did was to replace the whole of MsgBox "Message subject: " &...
  11. D

    Delete selected text from incoming emails

    When I pasted your code into the ThisOutlookSession and closed Outlook, on exiting I got a compile error: "Invalid attribute in Sub or Function" at the line "Private WithEvents objItems As Outlook.Items". Obviously the same thing happened when I restarted Outlook. I think I should use the...
  12. D

    Delete selected text from incoming emails

    Thank you for this, but having pored over it all for some time I am afraid I cannot make it work. I am much too much of a novice I suspect. Would it be possible for you to set out the full code here?
  13. D

    Delete selected text from incoming emails

    My incoming e-mails are all marked with an additional line of text at the start. I have been trying to work out how to delete that text automatically (either by using a rule plus a script or in some other automatic way) and I cannot find anything to show me exactly what I want to do. I think...
Top