2

How can I open .docx files in MFC? Because when I open a .docx file it puts "PK" to the editor. (This is at every .docx file I have opened)

L1-Cache
  • 91
  • 6
  • 1
    docx is not a text file format. Its a compressed XML file. You should see the same behavior if you read it in notepad – drescherjm Sep 30 '19 at 19:34
  • 1
    Related: [https://stackoverflow.com/questions/1161295/reading-docx-in-c](https://stackoverflow.com/questions/1161295/reading-docx-in-c) – drescherjm Sep 30 '19 at 19:35
  • 1
    Possible duplicate of [Reading .docx in C++](https://stackoverflow.com/questions/1161295/reading-docx-in-c) – Jabberwocky Oct 01 '19 at 09:07

1 Answers1

2

.docx files are .zip files with a different extension. The content of the zip is essentially a directory structure containing various XML files.

To open a .docx in a text editor would basically require unzipping the file to a directory then opening each XML file in your editor.

The actual format of .docx files can be found online.

jkb
  • 2,376
  • 1
  • 9
  • 12