0

I was given the task to translate all comments to a large MS Word file. In order to draft a bill I need to count all characters (including empty spaces) in all the original comment "bubbles". Now how does one do that? Manual counting would be difficult.

Could one somehow save all comments in a separate text file, in order to count them?

P.S. I've just tried saving the DOC document as an MHT file. All the comments display neatly at the bottom of the page. I can choose them all and right-click "copy". But when I open a new MS Word document and click "paste", nothing happens.

1

A docx file is a zip archive with a of number xml files in. One of those files are 'comments.xml' which contains all the comments. On my linux system I did the following to extract the text of all the comments. I did a simple test.docx file with a paragraph where I attached a comment.

unzip test.docx

xmllint --xpath "//*[local-name()='t']/text()" word/comments.xml 

Which return all the text of the comments. Hereafter it is just a simple character/word count.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.