Phpword: Reader/writer for Comments and Track-changes document parts

Created on 15 Sep 2015  路  14Comments  路  Source: PHPOffice/PHPWord

The document graph also contains comments and track changes. We would like to be able to also read those, so we can deduct statistics from it:

https://msdn.microsoft.com/en-us/library/bb266220(v=office.12).aspx

Can't find much info about why it isn't there, no issues related to comments or track changes can be found. If you guys tell me where to start then I'll try to make a PR for the Reader part.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

All 14 comments

Hello, did you manage tu turn on track changes in a document from PHPWord?

Yes, you can do that by editing word/settings.xml. The track changes is related to w:proofState and w:trackRevisions. If you set w:val to false for the latter that will turn it off.

Other interesting settings are w:spelling and w:grammar, which you can set to dirty to for instance re-enable all spelling checks.

You can edit w:revisionView in order to change what types of revisions are shown to the user.

@rvanlaak thanks for your fast response, really appreciate it :)

Can you point me to any type of documentation or resource regarding this xml file? I'm not sure if it is related to the OOXML standard or something else (I'm kind of new to editing word documents from PHP 馃槄 )?

The OOXML specs are documented quite decently, maybe this gives you some info already: http://officeopenxml.com/anatomyofOOXML.php

Otherwise try MSDN https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.proofstate(v=office.14).aspx

@rvanlaak Thanks for the links. Are you sure the "Track Changes" is related to w:proofState? I can only find info on grammar and spell checking on every site :(

Thanks, I found this blog post in case anybody needs more info: http://openxmldeveloper.org/discussions/formats/f/13/p/800/2032.aspx#2032

Ok so, since there is no reader/writer for tracking changes, I'll try making one and submit a PR

@rvanlaak Hello, I just submitted PR #966 that solves this. It has about 3 TODOs regarding documentation, which I need some help, if possible.

Also, I don't know the maintainers, so if you could mention them, that'd be nice 馃槃

@rvanlaak @chris-fa FYI, I submitted a PR (#1059) that allows you to add comments in a docx document.

@chris-fa Thanks for the PR, it's a nice job but I have since refactored the writer/reader for the settings.xml file so I will not merge your PR, but but feel free to check the new code. I think it should be even easier now to add new values to the settings.
Please check PhpOfficePhpWordMetadataSettings

@troosan can @chris-fa maybe rebase it against your rewrite then? Where could we find that?

... or do you mean that the rewrite includes all the features provided by this MR already?

@rvanlaak @chris-fa I'm doing it
I will implement
w:trackRevisions
w:doNotTrackMoves
w:doNotTrackFormatting
w:proofState
w:zoom

please check PR #1098

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaberu picture jaberu  路  3Comments

carlosvr90 picture carlosvr90  路  4Comments

igorsantos07 picture igorsantos07  路  3Comments

Joel-James picture Joel-James  路  3Comments

ahmednawazbutt picture ahmednawazbutt  路  3Comments