I vaguely heard of checksum
comparison.
Checksums work well for comparison of byte by byte exactness. If that's what you are looking for, then read the bytes of each document into a stream and use a SHA256Managed
or MD5CryptoServiceProvider
to generate a checksum for each file. If the two checksums are the same, then the two documents are most likely the same.
MD5 is not suitable for security purposes (http://en.wikipedia.org/wiki/MD5 - see "Security") but it should be fine for comparison purposes where you are in control of both documents. Also keep in mind that checksums are not 100% unique, so there is always the remote possibility of collision.
I have one that is generated from a
template document where some sections
are removed dynamically through
bookmarks and block sections from the
template.
However, if you are comparing section by section, then you may need to open the document up as more than raw bytes and deal with it in a structured fashion, e.g. section by section. You can programmatically open a .docx file using c# (using a variety of means); perhaps you can then perform a checksum against the contents of each section?
This thread talks about creating/manipulating .docx files using c#: How can a Word document be created in C#?. The same tools could be used to read one.