0

I dont know much about programming/developing. But I am facing a dilemma at my job. About each day I have to spend 20-30 minutes doing a manual repetitive task.

  1. open email, copy text from email, outlook.
  2. paste copied text into another app

Instead of doing this manually: opening each email, copy text and paste the text to the matching record into the other app I was hoping this could be all done automatically.

The email matches with the other app record based off two unique control numbers.

Looking at this site, I see this question asked

Automatically export specific emails to text file from Outlook

But I am hoping anyone could maybe provide what might be the best plans to do this: not the actual steps but what language(s) could I learn that would automate the process for me.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • Your question is too broad... is best if you try with a language and then you ask question over your code when you get stuck. I can see that the question you refer too follows this principle... did you try to apply that approach? – Valentin Ruano Nov 05 '17 at 04:31
  • If you want to extract the emails from Outlook directly VB is probrably the language of choice however if you keep the same emails in the server most languages have libraries that allow you to access the server directly and pull those emails which would perhaps give you a bit more freedom but might mean far more coding work and you are not and expert. – Valentin Ruano Nov 05 '17 at 04:34
  • .. also Outlook probably offer the possibility of performing some actions depending on the content of the email and perhaps you could use that in order to push them into the app or export them into a file that then you can push into the app with additional programming. The choice of language would depend on that destination app a bit but probably any general language like C++, Java, Python, etc would do. – Valentin Ruano Nov 05 '17 at 04:35

1 Answers1

0

Outlook does not like macros/programs, other than its own macros, looking at its emails. It is possible to get around this dislike but doing so will not be easy. Since you are not experienced, I believe the only suitable programming language is Outlook VBA; that is, you must write a macro to export text within Outlook.

An Outlook email can carry a text body and or an html body and or a rtf body. I have never seen a rtf body but the capability is there within Outlook. If an email has both an html and a text body, the user will see the html body. In my experience, the text body will be little more than the html body with all the formatting removed. If the html body is fairly simple, this can still give a useful text body for a macro to play with. But if the html body uses tables, for example, the text body can be useless.

How will you identify the emails from which text is to be extracted? (1) You can select one or more emails and then call a macro to process the selected emails. (2) You can run a macro at intervals to run down the Inbox looking for particular emails and process those. (3) There are more advanced techniques but get either approach 1 or 2 working then research “Outlook events”. If technique 1 appeals, look at the answer below then research "Outlook explorer". If technique 2 appeals, look at the answer recommended below.

Questions about extracting parts of emails are not uncommon. The problem with answering them is the difficulty of getting the questioner to understand that seeing an image of an email tells us little about the html that created that image. The macro in the answer below was written partly for my own research and partly to help others see the text and html bodies of their emails so they can better understand the processing required to meet their objective.

The macro in the answer, creates an Excel workbook and writes to it selected properties of selected emails. As written, the macro outputs details of every email in Inbox but contains comments explaining how to restrict output to the emails of interest. Start with this macro which contains a lot of material that you will find useful even if you decide the Outlook Explorer technique better meets your needs.

https://stackoverflow.com/a/12146315/973283

Tony Dallimore
  • 12,335
  • 7
  • 32
  • 61