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
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