Inspect Document

The Word API's Inspect Document feature can inspect and delete the following information (hereinafter "meta information") of files created in Microsoft Word:

Property and personal information

You can set the document property information shown in the red frame and the personal information shown in the blue frame for a Microsoft Word document by following two steps:

  1. Open Microsoft Word, select [File]-[Info] to configure settings.
  2. In File Explorer, right-click the target file and select [Properties]-[Details] to configure settings.

Document propeties and personal infomation image

The default settings in Microsoft Word automatically set the "Last Modified" date and "Created" date for property information and the "Author" and "Last Modified By" for personal information.

Hidden text

In Microsoft Word, you can set "hidden text," which are text decorations that are "displayed on the screen" but "not displayed when printing or exporting to PDF".
The "displayed on screen" can also be switched as shown in the figure below by validating/invalidating "Show/hide Editing Marks".

Hidden Image

Example

Here is an example of Microsoft Word and Word API "Inspect Document" for a document with meta information set.

Example of Microsoft Word

In Microsoft Word, you can check the inspection results in the target file by going to [File]-[Info]-[Check for Issues]-[Inspect Document].
Since meta information is set in the document, a warning will be displayed as shown in the figure below.

Inspect document image by Microsoft Word

Example of Word API

The Word API can also check meta information in the same way.
Except for the command line interface, it returns "inspect document" results.

Class Descriptions
InspectDocumentResult This class handles the results of "inspect document" and has the following member variables:
DocumentProperties: "true" if property information exists.
PersonalInformation: "true" if personal information exists.
HiddenTextt: "true" if hidden text exists.

The command line interface displays the "inspect document" results.
Because meta information is set in the document, it displays that each meta information is set as shown in figure below.

Inspect document image by Word API Command Line Interface

Removing meta information

For documents with meta information set, here is an example of removing meta information in Microsoft Word and the Word API.

Example of Microsoft Word

In Microsoft Word, target meta information can be removed by selecting "Remove All" in the "Inspect Document" results dialog.
The following figure shows an example of removing property information and personal information.

Remove Infomations image by Microsoft Word

Example of Word API

The Word API can also remove meta information in the same way.
Except for the command line interface, specify the following options for removing meta information.
In the command line interface, specify the parameters for removing meta information.

Class Descriptions
InspectDocumentRemoveOptions This class handles options for target of removing in "inspect document" and has the following member variables:
RemoveDocumentProperties: "true" if removing property information.
RemovePersonalInformation: "true" if removing personal information.
RemoveHiddenText: "true" if removing hidden text.

The following figure shows an example of property information and personal information removed.

Remove Infomations image by Word API

Sample files

[Install directory]/samples/templates/Inspect_document.zip contains sample files for setting meta information and hidden text.