The hidden data here refers to some of the basic attribute information that is stored by default in Office documents, and is likely to contain sensitive information such as companies, creators, signatures, comments, and so on.
For hidden information, Office provides us with a document inspector. You can open the Document Inspector in the Trust Center → personal Information options → document checker. As shown in Figure 14-26.
Figure 14-26 Document Inspector
The Document inspector is used to check for hidden information and provides a delete function. Now let's look at the personal information defined by office, includes the following: name and abbreviation, company and organization name, computer name, network server and hard drive, other file properties and summary information, OLE object, author information for different versions of the document, document revision information, document version information, template information, hidden text , revisions, and annotations.
When the check is performed, the item that contains the hidden information is listed and the deletion is given, as shown in Figure 14-27.
Figure 14-27 Document review Results
If you want to achieve more flexible functionality, you can call the Document Inspector in your code. In C #, you can invoke the functionality of the Document Inspector by calling the Microsoft.Office.Core.IdocumentInspector interface. If you have a VSTO programming base, you can write an office plug-in to implement some custom functionality. Of course, using the APIs provided by the open XML SDK makes it easier to implement the ability to manipulate hidden information. Code Listing 14-22 is an example of retrieving the properties of a Word document.
Code Listing 14-22 retrieving Word document properties
public static void Getpropertyfromdocument (string document)
{
XmlDocument xmlproperties = new XmlDocument ();
using (wordprocessingdocument WordDoc = Wordprocessingdocument.open (document, False))
{
Extendedfilepropertiespart Apppart = Worddoc.extendedfilepropertiespart;
Xmlproperties.load (Apppart.getstream ());
}
XmlNodeList chars = Xmlproperties.getelementsbytagname ("Characters");
MessageBox.Show (chars. Item (0). innertext);
}