简体   繁体   中英

Using propset svn:keywords on .docx files

I just found out this nice SVN option that would be very useful on our project, but yet again I'm having problems integrating it with word files, .docx to be exact.

I am using Tortoise client. If I create .txt file with $Rev$ content in it and put SVN property on it with Rev it works like a charm, in other words when I commit the change in the content of the file itself gets updated. When I use the same in .docx document, nothing happens. Has to be because it's not a textual file but binary?

Is there a way to integrate propset command for .docx files? People here don't have problems it seems, didn't work for me tho:( Click Ps: I also tried .doc files, same result.

Thanks for your replays.

Since doc and docx files are actually binary files, not text, you can't use the svn properties to expand keywords. It might work for doc files but you could corrupt those files that way. It definitely won't work for docx files since those are basically zipped xml files, and in the zipped file the keyword isn't there anymore in plain text.

But you could try this .

Option:

  1. Save your file as .xml instead of .docx; though your file gets much bigger (not zipped), you may save space with svn compression, more efficient on text than binaries, I expect
  2. Insert your snv keywords (eg $Rev$) in the properties of the word document (using File-Info, Properties in the right pane)
  3. Display the info in your document using fields: Isert-Quick Parts-Document Property, for example

That seems to work for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM