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.
Table of Contents
- 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
Remove Hidden Data and Personal Info from Microsoft Office Word
- Open the Word document.
- Click File tab > Save As > type a name in the File name box to save a copy of original document.
- Go to File tab > Info > Check for Issues > Inspect Document.
- Document Inspector dialog box will appear. Check or uncheck the content then click Inspect.
- 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.
- Click Close to finish.
Remove Hidden Data and Personal Info from Microsoft Office Excel Workbook
- Open the workbook.
- Click File tab > Save As > type a name in the File name box to save a copy of original document.
- Go to File tab > Info > Check for Issues > Inspect Document.
- Document Inspector dialog box will appear. Check or uncheck the content then click Inspect.
- 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.
- Click Close to finish.
Remove Hidden Data and Personal Info from Microsoft Office PowerPoint Presentation
- Open the PowerPoint presentation.
- Click File tab > Save As > type a name in the File name box to save a copy of original document.
- Go to File tab > Info > Check for Issues > Inspect Document.
- Document Inspector dialog box will appear. Check or uncheck the content then click Inspect.
- 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.
- Click Close to finish.
Remove Hidden Data and Personal Info from Microsoft Office Visio
- Open the PowerPoint presentation.
- Click File > Info > Remove Personal Information.
- Click the Personal Information tab.
- Select the Remove these items from the document check box.
- To remove potentially sensitive data from external data sources, select the Remove data from external sources stored in the document check box.
- Click Close to finish.
Inspect Document on Quick Access Toolbar
- Go to Customize Quick Access Toolbar, choose All Commands then scroll down to Inspect Document.
- Click on Add button in order to add Inspect Document button into Customize Quick Access Toolbar.
- 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 https://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.