Protecting Office Documents programmatically using Rights Management Services
This MSDN Code Gallery release contains the Microsoft Office File Format Protectors. They are COM components that enable you to protect and unprotect files in Microsoft Office formats, such as .docx, .xlsx, .doc, and others. These protectors are file handlers that take in parameters and output the protected or unprotected Microsoft Office file, depending on your needs.
It is important to note that although the protectors protect and unprotect files, the calling application is responsible for making calls to AD RMS to encrypt or decrypt the data and acquire the proper licenses. More information on this is included in the documentation.
What is Included With This Release?
This release contains a sample project for use in Visual Studio 2005 that contains the protector components and other supporting code. It also contains a reference document for the protectors.
Two Types of Protectors
There are two protector types: the MsoIrmProtector and the OpcIrmProtector.
MsoIrmProtector supports the following file types: doc, dot, xla, xls, xlt, pps, and ppt
OpcIrmProtector supports the following file types: docm, docx, dotm, dotx, xlam, xlsb, xlsm, xlsx, xltm, xltx, xps, potm, potx, ppsx, ppsm, pptm, pptx, and thmx
For more information go to https://code.msdn.microsoft.com/OfficeProtectors