Ask a Question

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

david_bird
Occasional Contributor

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.
5 REPLIES 5
TanyaYatskovska
Community Manager

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


Hi David,


 


Refer to the "Receive e-mail messages via MS Outlook" How To article - it contains an example that should help you.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
leandropoblet
Frequent Contributor

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

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
Frequent Contributor

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

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

Colin_McCrae
Community Hero

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

See your other post as well.

 

You want the "Body" property of the MailItem that script example returns.

 

https://msdn.microsoft.com/en-us/library/office/ff865304.aspx

 

Smiley Wink

leandropoblet
Frequent Contributor

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

Hi Colin,
Thanks for your reply. That's exactly what I needed: the whole list so I can now play with all properties and methods from those emails.

Cheers,
Leandro
cancel
Showing results for 
Search instead for 
Did you mean: