Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2011, 09:52 AM
ghumdinger ghumdinger is offline Batch run "inspect documents" Windows 7 Batch run "inspect documents" Office 2010 (Version 14.0)
Advanced Beginner
Batch run "inspect documents"
 
Join Date: Jul 2010
Posts: 64
ghumdinger is on a distinguished road
Default Batch run "inspect documents"

In Office 2010, there is an option to check the documents for meta data and such using File> Prepare for sharing> Inspect document.

I have a ton of documents whose meta data I need to clear before sending out.

Is there a way to batch run this function, ala Acrobat's Action Wizard?



Thanks & cheers,
Jay
Reply With Quote
  #2  
Old 07-17-2011, 01:18 AM
macropod's Avatar
macropod macropod is online now Batch run "inspect documents" Windows 7 64bit Batch run "inspect documents" Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
Run the macro and select a folder to process. All documents in that folder will be processed. The modified files are saved to a folder named 'Output' below the selected folder. As coded, the macro removes only the std personal info. The 'RemoveDocumentInformation' method takes various 'RemoveDocInfoType' parameters. You may want to use different ones instead or as well.

Note: Protected files are liable to cause the macro to fail.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-21-2011, 09:49 AM
ghumdinger ghumdinger is offline Batch run &quot;inspect documents&quot; Windows 7 Batch run &quot;inspect documents&quot; Office 2010 (Version 14.0)
Advanced Beginner
Batch run &quot;inspect documents&quot;
 
Join Date: Jul 2010
Posts: 64
ghumdinger is on a distinguished road
Default

Thanks Paul.

On a side note, do you know of any macro books for beginners that you would recommend?

I would probably look up some reviews on Amazon one of these days.... but if there's something you suggest, I'll just head straight for that.

Jay
Reply With Quote
  #4  
Old 07-21-2011, 04:53 PM
macropod's Avatar
macropod macropod is online now Batch run &quot;inspect documents&quot; Windows 7 64bit Batch run &quot;inspect documents&quot; Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Jay,

Sorry, but I've never had any recourse to such books (though I've contributed to a couple that consider but don't focus on programming), so I'm not in a position to make any recommendations.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



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
Batch run &quot;inspect documents&quot; "Table of content" based on "Normal Style" behavior!!!! Jamal NUMAN Word 4 07-08-2011 04:12 AM
Batch run &quot;inspect documents&quot; 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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft