How do I Remove Hidden Data, Personal Info and Metadata from Microsoft Office Documents

You may not be aware that Microsoft Office documents such as Word, Excel, PowerPoint and Visio files often contain hidden or personal information like comments, revision marks, headers, footers and watermarks. This could place you in an embarrassing or compromising position.

In order to protect any sensitive information from accidentally being made public, perform the following steps before sharing a document with other people.

Microsoft Office Inspect Document

Content Summary

Remove Hidden Data and Personal Info from Microsoft Office Word
Remove Hidden Data and Personal Info from Microsoft Office Excel Workbook
Remove Hidden Data and Personal Info from Microsoft Office PowerPoint Presentation
Remove Hidden Data and Personal Info from Microsoft Office Visio
Inspect Document on Quick Access Toolbar
Custom VBA script to Automate Document Inspection Process
Document.RemoveDocumentInformation Method
Reference

Remove Hidden Data and Personal Info from Microsoft Office Word

Step 1: Open the Word document.

Step 2: Click File tab > Save As > type a name in the File name box to save a copy of original document.

Step 3: Go to File tab > Info > Check for Issues > Inspect Document.

Step 4: Document Inspector dialog box will appear. Check or uncheck the content then click Inspect.

Step 5: Inspection results will show an exclamation mark for any categories where it found potentially sensitive data, and it will also have a Remove All button for each of these categories. Click Remove All to remove the data.

Step 6: Click Close to finish.

Remove Hidden Data and Personal Info from Microsoft Office Excel Workbook

Step 1: Open the workbook.

Step 2: Click File tab > Save As > type a name in the File name box to save a copy of original document.

Step 3: Go to File tab > Info > Check for Issues > Inspect Document.

Step 4: Document Inspector dialog box will appear. Check or uncheck the content then click Inspect.

Step 5: Inspection results will show an exclamation mark for any categories where it found potentially sensitive data, and it will also have a Remove All button for each of these categories. Click Remove All to remove the data.

Step 6: Click Close to finish.

Remove Hidden Data and Personal Info from Microsoft Office PowerPoint Presentation

Step 1: Open the PowerPoint presentation.

Step 2: Click File tab > Save As > type a name in the File name box to save a copy of original document.

Step 3: Go to File tab > Info > Check for Issues > Inspect Document.

Step 4: Document Inspector dialog box will appear. Check or uncheck the content then click Inspect.

Step 5: Inspection results will show an exclamation mark for any categories where it found potentially sensitive data, and it will also have a Remove All button for each of these categories. Click Remove All to remove the data.

Step 6: Click Close to finish.

Remove Hidden Data and Personal Info from Microsoft Office Visio

Step 1: Open the PowerPoint presentation.

Step 2: Click File > Info > Remove Personal Information.

Step 3: Click the Personal Information tab.

Step 4: Select the Remove these items from the document check box.

Step 5: To remove potentially sensitive data from external data sources, select the Remove data from external sources stored in the document check box.

Step 6: Click Close to finish.

Inspect Document on Quick Access Toolbar

Step 1: Go to Customize Quick Access Toolbar, choose All Commands then scroll down to Inspect Document.

Inspect Document on Quick Access Toolbar

Step 2: Click on Add button in order to add Inspect Document button into Customize Quick Access Toolbar.

Step 3: Click Inspect Document button in the Quick Access Toolbar to start inspection.

Custom VBA script to Automate Document Inspection Process

Sub InspectTheDocument()
' based on code from Bernadette at http://www.vbaexpress.com/forum/showthread.php?42228-Document-Inspect
Dim docStatus As MsoDocInspectorStatus
Dim results As String
Dim ComboResults As String
' Turn off Tracking and accept all changes.
Application.ActiveDocument.TrackRevisions = False
WordBasic.AcceptAllChangesInDoc
' Removes all document metadata and 'extras'
Application.ActiveDocument.RemoveDocumentInformation (wdRDIAll)
' OR be more selective with statements like
'Application.ActiveDocument.RemoveDocumentInformation (wdRDIComments)
'Application.ActiveDocument.RemoveDocumentInformation (wdRDIDocumentProperties)
' Application.ActiveDocument.RemoveDocumentInformation (wdRDIRemovePersonalInformation)
' These two lines change document properties so that
' Personal Info or Date/Time are not saved in future
Application.ActiveDocument.RemovePersonalInformation = True
Application.ActiveDocument.RemoveDateAndTime = True
' Collapsed Headings
ActiveDocument.DocumentInspectors(1).Fix docStatus, results
ComboResults = results
' Headers, Footers and Watermarks
ActiveDocument.DocumentInspectors(3).Fix docStatus, results
ComboResults = ComboResults & results
' Comment this out unless you want the interruption
MsgBox ("The following items were removed " & ComboResults)
' display on status bar
Application.StatusBar = "Removed:" & ComboResults
' save the document
ActiveDocument.Save

Document.RemoveDocumentInformation Method

Use Application.ActiveDocument.RemoveDocumentInformation (wdRDIAll) to remove all extra document info. Or use a series of commands to select exactly what you want removed.

wdRDIAll
99 Removes all document information.

wdRDIComments
1 Removes document comments.

wdRDIContentType
16 Removes content type information.

wdRDIDocumentManagementPolicy
15 Removes document management policy information.

wdRDIDocumentProperties
8 Removes document properties.

wdRDIDocumentServerProperties
14 Removes document server properties.

wdRDIDocumentWorkspace
10 Removes document workspace information.

wdRDIEmailHeader
5 Removes e-mail header information.

wdRDIInkAnnotTations
11 Removes ink annotations.

wdRDIRemovePersonalInformation
4 Removes personal information.

wdRDIRevisions
2 Removes revision marks.

wdRDIRoutingSlip
6 Removes routing slip information.

wdRDISendForReview
7 Removes information stored when sending a document for review.

wdRDITemplate
9 Removes template information.

wdRDITaskpaneWebExtensions
17 Removes taskpane web extensions information.

wdRDIVersions
3 Removes document version information.

Reference

Microsoft Office Support: Remove hidden data and personal information by inspecting documents, presentations, or workbooks
Microsoft Developer Network: Document.RemoveDocumentInformation Method (WdRemoveDocInfoType)
Microsoft Docs: WdRemoveDocInfoType Enum