PDA

View Full Version : Turn on Track changes for all .doc in directory



Mickshelly
02-09-2011, 01:37 PM
I am running Win 7 pro and Office 2007 pro...
Before I send each employee their resume (.doc) to update (~200), I want to turn track changes on. Is there a macro I can run on the whole dir to open, turn track changes on, save, close? and how do i run the macro?:banghead:

fumei
02-14-2011, 11:29 AM
Yes. Use the Dir function. That is what it is used for: opening all documents in a folder (DIRectory), doing something, save and close them.

Mickshelly
02-14-2011, 12:20 PM
Congratulations Short Timer!! What's next for you?

here is what i came up with and it worked as a toggle. So the ones that already had Track Changes turned on got turned off.

Sub TurnOnTC()
'
' TurnOnTC Macro
' Turn on track changes for all documents in directory
'
FName = Dir("C:\Resume Project\*.doc")
Do While (FName <> "")
With wrd
Documents.Open ("C:\Resume Project\" & FName), _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:=""
ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions
ActiveDocument.Save
ActiveDocument.Close
End With
FName = Dir
Loop
Set wd = Nothing
End Sub

fumei
02-14-2011, 02:27 PM
Good one. That is how it is done.

sherryjoo
08-04-2011, 08:00 AM
May I ask how would you get it to do subdirectories too? Thanks!!!

Frosty
08-04-2011, 09:11 AM
At that point, you'll want to use the FileSystemObject, do a search, come up with something, and then make a new thread probably