PDA

View Full Version : Document Inspect



Bernadette
05-18-2012, 10:31 AM
Hello All,

I have documents that must be cleaned for security purposes. I have a macro (Document Inspect) that does this, however after I save, close and re-open the document the "Custom XML" is back again when I do another Document Inspect. Any help would be appreciated.

I am using Word 2007. I have attached the Word document and here is the code for the macro:

Sub InspectTheDocument()

Dim docStatus As MsoDocInspectorStatus
Dim results As String
Application.ActiveDocument.TrackRevisions = False
WordBasic.AcceptAllChangesInDoc

Application.ActiveDocument.RemoveDocumentInformation (wdRDIComments)
Application.ActiveDocument.RemoveDocumentInformation (wdRDIDocumentProperties)
Application.ActiveDocument.RemoveDocumentInformation (wdRDIRemovePersonalInformation)
Application.ActiveDocument.RemovePersonalInformation = True
Application.ActiveDocument.RemoveDateAndTime = True

ActiveDocument.DocumentInspectors(1).Fix docStatus, results

ActiveDocument.DocumentInspectors(3).Fix docStatus, results

End Sub

geekgirlau
05-22-2012, 05:55 PM
I ran the code in your document, saved the file then ran the Document Inspector - "No custom XML data was found". Are you seeing something different?

BoatwrenchV8
05-23-2012, 12:30 PM
Opened your attached document in Word 2010, used document inspector to clean it, saved it and then re opened it. used document inspector again and it did not find any xml code. maybe 2010 is more aggressive than 2007?