Take the 2-minute tour ×

How can I read a Word (.doc) file in Qt? I want the text to appear formatted exactly like the Word document without any loss.

share|improve this question
Google docs and libreoffice (among many others) have been trying that for years. –  cnicutar Aug 19 '12 at 8:13
it can be done using active_x object but I'm not able to figure out how. –  user1603594 Aug 19 '12 at 8:15
Perhaps have a look into RTF instead. Qt has support for rich text. –  Bart Aug 19 '12 at 8:50
If you go Windows-only, try what Marcus suggests. Cross-platform using Calligra's (calligra-suite.org) libraries might be the best bet. No third-party solution will give you exactly the same formatting as in Word though. –  Frank Osterfeld Aug 19 '12 at 9:38
@cnicutar: not to mention, MS themselves try hard to get the formatting the same between versions. –  Caleb Huitt - cjhuitt Aug 23 '12 at 19:20
add comment

1 Answer

Take a look at this Microsoft Knowledge Base article, it describes where the documentation for the ActiveX objects can be found. ActiveX Widgets can be accesed from Qt via the QAxWidget, queries are issued using QAxBase::querySubObject().

Edit: And take a look at this answer. It adds some code samples to my answer.

share|improve this answer
add comment

Your Answer


