![]() |
|
#2
|
||||
|
||||
|
Hi Jay,
You can do this with a macro: Code:
Sub Anonymizer()
Application.ScreenUpdating = False
Dim strInFold As String, strOutFold As String, strFile As String, strOutFile As String, DocSrc As Document
'Call the GetFolder Function to determine the folder to process
strInFold = GetFolder
If strInFold = "" Then Exit Sub
strFile = Dir(strInFold & "\*.doc", vbNormal)
'Check for documents in the folder - exit if none found
If strFile <> "" Then strOutFold = strInFold & "\Output\"
'Test for an existing outpfolder & create one if it doesn't already exist
If Dir(strOutFold, vbDirectory) = "" Then MkDir strOutFold
strFile = Dir(strInFold & "\*.doc", vbNormal)
'Process all documents in the chosen folder
While strFile <> ""
Set DocSrc = Documents.Open(FileName:=strInFold & "\" & strFile, AddTorecentFiles:=False, Visible:=False)
With DocSrc
'remove personal information
.RemoveDocumentInformation (wdRDIDocumentProperties)
'String variable for the output filenames
strOutFile = strOutFold & Split(.Name, ".")(0)
'Save and close the document
.SaveAs FileName:=strOutFile
.Close
End With
strFile = Dir()
Wend
Set Rng = Nothing: Set DocSrc = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder(Optional Title As String, Optional RootFolder As Variant) As String
On Error Resume Next
GetFolder = CreateObject("Shell.Application").BrowseForFolder(0, Title, 0, RootFolder).Items.Item.Path
End Function
Note: Protected files are liable to cause the macro to fail.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wierd symbols inplace of "space", "indentation" etc | aka.bhagvanji | Word | 5 | 02-16-2012 11:50 AM |
"Table of content" based on "Normal Style" behavior!!!!
|
Jamal NUMAN | Word | 4 | 07-08-2011 04:12 AM |
How to choose a "List" for certain "Heading" from "Modify" tool?
|
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |
| How to have colons (:) in the "Table of content" but to be hidden in the "Heading"? | Jamal NUMAN | Word | 0 | 06-26-2011 04:53 PM |
| "Microsoft Excel Application" missing in the "Component Services" on win08 | sword.fish | Excel | 0 | 02-26-2010 02:09 PM |