Forum Discussion

david_bird's avatar
david_bird
Occasional Contributor
12 years ago

How to get the text of an email from MS Outlook Folder

I have been struggling with getting some text out of an email message the is in one of my MS Outlook folders.



On the surface it would seem that recording the actions to select the email in a running instance of MS Outlook, copy the required text to the clipboard and then paste it in to a textbox in a web application running in Internet Explorer would be the way to go.



The answer is yes and no.



Recording the actions is one thing but getting the selected text out of Outlook is another.



I have tried all ways - including right clicking the selected text, followed by selecting Copy from the context menu that pops up. I've also tried coding the keys for CTRL+C.



Neither way works reliably and it is the Outlook end of thinks that is unreliable. Pasting what is in the clipboard is no problem.



I've scrolled through forum posts and help files, etc and cannot crack this problem no matter what I try.



I suspect I have to deal with MS Outlook as an object in some way but being a novice at this I could do with somew help.



Thanks in advance.



DavidB.
    • leandropoblet's avatar
      leandropoblet
      Frequent Contributor

      The pointed article doesn't explain how to get the text (content) on an email: "The script below demonstrates how to receive e-mail messages in MS Outlook and to check whether an e-mail message with the specified subject was received."

       

      Can I please get the code to process whatever the content is in the email once found?

      Additionally can you explain how to deal with, for example, automated notification emails (pretty much same content/subject/etc but received different days) 

       

      Cheers!

      • leandropoblet's avatar
        leandropoblet
        Frequent Contributor

        Nothing?
        I'd also need to filter emails by date/time.... which doesn't seem possible in the provided script