Bren Gunning
Bren Gunning

Reputation: 390

Getting Outlook .msg file contents with Objective-C

I am writing an app for the iPhone and iPad and I need it to show a preview of an Outlook .msg file. Quick Look, unsurprisingly, doesn't support this file type and therefore I need some way of parsing the contents.

Is there any way of getting the contents of an Outlook .msg file with Objective-C? I want to be able to view the contents as HTML (even if I have to manipulate the contents a bit afterwards) I've seen references made to using OLE streams and possibly XML parsing in Windows but not sure how these apply in Objective-C. There are .msg reader apps out there for iOS, so I know it's possible but struggling to do it.

Thanks for any help.

Upvotes: 1

Views: 2455

Answers (2)

Codo
Codo

Reputation: 78795

Outlook .msg files are stored as OLE compound documents (aka COM stuctured storage). So you mainly need a library to read this format. A quick search turned up POLE and libgsf. They are written in C++ and C, respectively, but that's supported on the iPhone as well.

Then there's some file format information that shows how the compound document format is used to store the different parts of an email.

Upvotes: 4

Related Questions