pstack
pstack

Reputation: 11

Parse html table as plain text with ews-java-api

I fetch emails from the Exchange Server with the ews-java-api. As I do not want to deal with html I parse the body to text using the ews functionality

 PropertySet propertySet = new PropertySet(BasePropertySet.FirstClassProperties)
 propertySet.requestedBodyType = BodyType.Text

This works fine most of the time. For some html tables however it happens that after every column there is a linebreak e.g.

ColName1 ColName2
A B

converts to

ColName1

ColName2

A

B

In Outlook GUI there exists the function "Move>Actions>Edit Message" where when I click in the table and select "Layout>Data>Covert to Text" Outlook asks me "Separate Text with...."

  1. Paragraph Marks

  2. Tabs

  3. ...

When I select "Tabs" the table remains in a table like style. When I select "paragraph Marks" it renders the above described format.

Anybody has an idea how to tell the ews api to break down the tables with "Tabs"? Or any other feasible solution?

Thank you in advance for your help!

Upvotes: 1

Views: 175

Answers (0)

Related Questions