#1
|
|||
|
|||
Remove title property from all files in a folder
I am unsure how to edit this code so that it removes the title property from all files in a folder.
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 |
#2
|
|||
|
|||
I already does. It puts the new files (stripped of data) in the Output sub-folder of the folder you selected. The original files are preserved. You can delete them if you want.
|
#3
|
|||
|
|||
Yes it does. I swear it did not worked earlier. Maybe because I stopped it before it finished. It was processing 200+ documents; it was taking a while.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Move files from one folder to another | obasanla | Word | 1 | 09-28-2012 04:42 PM |
outlook 2003 always not remove temp copy of opened attachments in temporary folder | c.itech | Outlook | 0 | 06-20-2011 10:34 PM |
Outlook 2007: how to remove RSS folder | minkowski | Outlook | 2 | 04-24-2011 11:25 PM |
Cannot remove replaced personal folder | rumin | Outlook | 2 | 01-31-2011 08:28 AM |
Adding a field to a folder of PDF files. | Balliol | Windows | 0 | 11-22-2009 02:02 PM |